error cannot instantiate non-existent class

From: Date: Fri, 12 Sep 2003 19:28:15 +0000
Subject: error cannot instantiate non-existent class
Groups: php.general 
Request: Send a blank email to php-general+get-162461@lists.php.net to get a copy of this message
I am newbie with php and I am trying to instantiate a class. I am using the command line to test my stuff out before I try it with a browser. The following is my class code: (name of file is AddConfigs.inc) <?php class AddConfigs{ var $config; function AddConfigs($config){ this->$config = $config; echo " in constructor $config "; echo " in constructor statement 2 ".$config; } } ?> The following is the code of the file I am trying to instantiate the class with: (name of file is test.php) <?php require('C:/Program Files/Apache Group/Apache2/htdocs/Alarms/AddConfigs.inc'); $a = new AddConfigs('testing'); ?> I type in "php test1" and I get the following errors: Parse error: parse error, unexpected T_OBJECT_OPERATOR in C:\Program Files\Apache Group\Apache2\htdocs\Alarms\AddConfigs.inc on line 7 Fatal error: Cannot instantiate non-existent class: addconfigs in C:\Program Files\Apache Group\Apache2\htdocs\Alarms\test1.php on line 4 Please can someone help me...? Many Thanks Moiz

« previous php.general (#162461) next »