I am stuck: Error on a line that begins with the word "const" !!

This is a discussion on I am stuck: Error on a line that begins with the word "const" !! within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Me again! I am trying to create a currency converter function for my eCommerce that still pet treats. I am ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-08-2007
adam.timberlake@gmail.com
 
Posts: n/a
Default I am stuck: Error on a line that begins with the word "const" !!

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=1503

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 = 'talkphp_conversion_rates.json';

Please help! Also, somebody mentioned something about cross-posting on
newsgroups so that I can post to more than 1 group in case I do not
get a good answer in 1. Could somebody tell me how to do this with
Google Groups please!!

Thannk you.
Reply With Quote
  #2 (permalink)  
Old 12-08-2007
macca
 
Posts: n/a
Default Re: I am stuck: Error on a line that begins with the word "const" !!


> My server is CentOS 4 or 5, I forget which, running PHP 4.1.0 with...




You are trying to use a class constant ("const"). It seems like you
are trying to do some OOP (Object Oriented Programming), i don't think
"const" was not introduced into the PHP OOP model until php5.

Either replace "const" with define('const_name','value') or update
your php version to php5.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:25 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0