Object Oriented Programming

From: Date: Wed, 29 Mar 2000 20:37:00 +0000
Subject: Object Oriented Programming
Groups: php.version4 
Request: Send a blank email to php-version4+get-12829@lists.php.net to get a copy of this message
I'm using PHP 4 and am trying to branch into Object oriented programming. I've copied examples from the Profesional Php Programming book. Problem is I keep getting an error when defining a function in a class. Here is an abbreviated form of the class Session { // Define the properties: var $seshid; var $userid; // Define the methods: function Session($this->seshid,$this->userid=0){ // connect to MySQL etc } } I get a parse error that PHP is expecting a closing ')' even though there are the correct number of parenthesis on the line with function Session. It seems that it's not liking the "$this->" syntax. Does anyone know why? Thanks Scott xjab@fastband.com

« previous php.version4 (#12829) next »