Mombu the Php Forum

Go Back   Mombu the Php Forum > Php > Parse error in PHP4 but not PHP5
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 1st November 06:08
jon
External User
 
Posts: 1
Default Parse error in PHP4 but not PHP5



Hi,

I have some code which runs fine on my development server running
PHP5.2.4, but I'm getting a parse error on the production server
running PHP4.4.7 .

"Parse error: parse error, unexpected T_STRING, expecting
T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in .... on line 9"

It's a pretty basic class declaration and I can't imagine there'd be a
huge difference between PHP4 and 5 in the syntax. Could someone point
out the very simple thing I'm doing wrong?

<?php

require_once 'config.php';
require_once '../shared/mysql_libs.php';
require_once '../shared/html_libs.php';
require_once '../shared/recaptcha-php-1.10/recaptchalib.php';

class classifieds_post {
private $db = NULL; <------------------ line 9
private $cat_array = NULL;
private $admin = FALSE;

private $post_id = NULL;
private $post_cat = NULL;
  Reply With Quote


 


2 1st November 06:08
zeldorblat
External User
 
Posts: 1
Default Parse error in PHP4 but not PHP5



In PHP4 all class members are public. There is no private, protected,
or public. You declare your variables with the "var" keyword instead:

class classifieds_post {
var $db = NULL;
var $cat_array = NULL;
var $admin = FALSE;
  Reply With Quote
3 1st November 12:01
jon
External User
 
Posts: 1
Default Parse error in PHP4 but not PHP5


Thanks!
  Reply With Quote
Reply


Thread Tools
Display Modes




666