You are here: Re: I am stuck: Error on a line that begins with the word "const" !! « PHP Programming Language « IT news, forums, messages
Re: I am stuck: Error on a line that begins with the word "const" !!

Posted by Rik Wasmus on 12/08/07 01:11

On Sat, 08 Dec 2007 01:57:49 +0100, <adam.timberlake@gmail.com> wrote:

> Me again! I am trying to create a currency converter function for my
> eCommerce that still pet treats. I am a little short on money recently=

> and so cannot afford a programmer. Can somebody tell me why my script
> tells me that I have a syntax error on the "CONST" line. I am trying
> to follow the article below.
>
> Article: http://www.talkphp.com/showthread.php?t=3D1503
>
> The error I get is:
>
> Parse error: parse error, expecting `T_OLD_FUNCTION' or
> `T_FUNCTION'...
>
> My server is CentOS 4 or 5, I forget which, running PHP 4.1.0 with
> MySQL 5, I think. The line that it shows me the error on is:
>
> const OPT_FILE =3D 'talkphp_conversion_rates.json';

A class 'const' is not possible in PHP4, the same goes for =

'private'/'public'/'protected' class variables (they all are public, and=
=

created with the keyword 'var'). Consult the manual for changes between =
=

PHP 4 & PHP 5:
http://nl2.php.net/manual/en/language.oop.php
http://nl2.php.net/manual/en/language.oop5.php

PHP 5 is pretty old now, and stable, so seriously consider upgrading if =
=

you want to do anything with OOP.
-- =

Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация