Re: Simple class declaration returns error
| From: | Dave M G | Date: | Thu, 15 Jun 2006 07:21:43 +0000 |
| Subject: | Re: Simple class declaration returns error | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-238048@lists.php.net to get a copy of this message | ||
PHP List,
Okay, I've upgraded to php 5 on my home machine, and I'm still getting some syntax errors.
Parse error: syntax error, unexpected T_NEW in /home/dave/web_sites/thinkingworks.com/web/database.class on line 5
This is the code producing the error:
class database {
public static $database = new database;
I've also tried:
private static $database = new database;
and:
private static $database = new database;
and:
public static $database = 'database';
The last of which I copied directly from the PHP manual.
I'm just starting out with objects this week, so I know I am missing a very basic thing. If anyone can nudge me in the right direction, that would be fantastic.
Thank you for your advice.
--
Dave M G