Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27520 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9239 invoked by uid 1010); 18 Jan 2007 14:21:07 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 9224 invoked from network); 18 Jan 2007 14:21:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jan 2007 14:21:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=antony@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=antony@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: antony@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from [212.25.124.162] ([212.25.124.162:62535] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3B/74-16601-2528FA54 for ; Thu, 18 Jan 2007 09:21:07 -0500 Received: (qmail 30497 invoked from network); 18 Jan 2007 14:19:26 -0000 Received: from internal.zend.office (HELO ?127.0.0.1?) (10.1.1.1) by internal.zend.office with SMTP; 18 Jan 2007 14:19:26 -0000 Message-ID: <45AF824C.5000703@zend.com> Date: Thu, 18 Jan 2007 17:21:00 +0300 User-Agent: Thunderbird 1.5.0.8 (X11/20061025) MIME-Version: 1.0 To: Jingcheng Zhang CC: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Problems on PHP5 object instantiation From: antony@zend.com (Antony Dovgal) On 01/18/2007 05:06 PM, Jingcheng Zhang wrote: > Hi, > I'm now trying OOP in PHP5, and enjoy it very much. However, as we know > PHP5 does not allow compile-time instantiation, > so when I try this script: > > class C { > static private $o = new stdClass(); > } > ?> Class properties are initialized in compile time, therefore they cannot be initialized with expressions, which are executed in runtime. -- Wbr, Antony Dovgal