[PHP] error cannot instantiate non-existent class

2003-09-12 Thread Golawala, Moiz M (IndSys, GE Interlogix)
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)
$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)



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



Re: [PHP] error cannot instantiate non-existent class

2003-09-12 Thread CPT John W. Holmes
From: "Golawala, Moiz M (IndSys, GE Interlogix)" <[EMAIL PROTECTED]>

> I am newbie with php and I am trying to instantiate a
> class.

Welcome to PHP.

> this->$config = $config;

$this->config = $config;

> 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

That first error is being caused by your syntax error above. Since there is
parse error in the class file, the second file cannot create an instance of
the class, hence the second error. Fix that line above and both will go
away.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php