Basic OOP Question

From: Date: Thu, 26 Jan 2006 21:42:15 +0000
Subject: Basic OOP Question
Groups: php.general 
Request: Send a blank email to php-general+get-229343@lists.php.net to get a copy of this message
Hi, This is my first post so a cheery hello, this script from php.net: [www.php.net] <?php class SimpleClass { // member declaration public $var = 'a default value'; // method declaration public function displayVar() {
       echo $this->var;
} } mySimpleClass = new SimpleClass(); ?> Returned this: Parse error: parse error, unexpected T_STRING, expecting T_FUNCTION in /Users/chris/Sites/php/oop/simple.php on line 4 I'm running PHP Version 5.0.4, with MAC OS 10.4.4

« previous php.general (#229343) next »