Page 1 of 1

what am I missing?

Posted: Sat Jan 14, 2006 11:57 am
by jonathant
Am I missing something? I'm new to php, and I am trying to make the jump from php4 to 5.

"Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /path_to_file/auctions.php5 on line 5"

Code: Select all

<?php
class Auction 
{
	// error checking
	public $err_no;
	public $err;

... rest of class

Posted: Sat Jan 14, 2006 1:28 pm
by jwalsh
use var instead of public.

Posted: Sat Jan 14, 2006 1:41 pm
by Jenk
no, php5 allows use of 'public $var;'

What is on the rest of the line?

As the error says you have an unexpected string, so you must have a stray string on that line, or missing a } / ) above it.

Please post entire class def :)

Posted: Sat Jan 14, 2006 1:54 pm
by jonathant
DOH! I was running the script on it's own and getting no errors. But when I did require(auctions.php5) I was getting the error. Finally, I realized that I was requiring it on a php4 file. duh!