Re: Problems on PHP5 object instantiation
| From: | Antony Dovgal | Date: | Thu, 18 Jan 2007 14:21:00 +0000 |
| Subject: | Re: Problems on PHP5 object instantiation | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-27520@lists.php.net to get a copy of this message | ||
On 01/18/2007 05:06 PM, Jingcheng Zhang wrote:
Hi,Class properties are initialized in compile time, therefore they cannot be initialized with expressions, which are executed in runtime. -- Wbr, Antony DovgalI'm now trying OOP in PHP5, and enjoy it very much. However, as we knowPHP5 does not allow compile-time instantiation, so when I try this script: <?php class C {static private $o = new stdClass();} ?>