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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php