PHP 5 Code:
<?php
class form
{
public $name;
public $fields;
}
?>
class form
{
public $name;
public $fields;
}
?>
Error:
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in C:\x\y\page.php on line z
The problem is that PHP 4 has a different syntax for classes. The code above is PHP 5 valid, but not PHP 4. A valid version of its PHP 4 equivalent is this:
PHP 4 Code:
<?php
class form
{
var $name;
var $fields;
}
?>
class form
{
var $name;
var $fields;
}
?>
No comments:
Post a Comment