Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19775 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55141 invoked by uid 1010); 28 Oct 2005 05:09:53 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 55123 invoked from network); 28 Oct 2005 05:09:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Oct 2005 05:09:53 -0000 X-Host-Fingerprint: 198.237.84.92 unknown Linux 2.4/2.6 Received: from ([198.237.84.92:1307] helo=bobsilva.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id E1/A4-22886-0A2B1634 for ; Fri, 28 Oct 2005 01:09:53 -0400 Received: from [198.237.84.93] (HELO jake) by bobsilva.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 675385 for internals@lists.php.net; Thu, 27 Oct 2005 18:50:38 -0700 To: Date: Thu, 27 Oct 2005 22:09:41 -0700 Message-ID: <000301c5db7d$cd579070$5d54edc6@jake> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0004_01C5DB43.20F8B870" X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcXbfc1LUdoALP8QQsSCLrEU7uEt0Q== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 Subject: Question on arrays as properties From: me@bobsilva.com ("Bob Silva") ------=_NextPart_000_0004_01C5DB43.20F8B870 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, Am I correct in saying that a class property cannot be initialized to an array? Looking at zend_declare_property it clearly states that Internal zvals cant be arrays. So how would I go about creating the following inherited property in all my subclasses if my core class has this property? class ZObject { protected $_props = array(); . } class ZString { public function __construct() { $this->setProperty($name, $value) } public function setProperty($name, $value) { $this->_props['value']; } } In other words, how would I create a property that is an array (in C) where that property is available to all my subclasses WITHOUT initializing it manually in the __construct, which would force each subclass constructor to call its parent (while good design, I'd prefer not to have this constraint). Thanks Bob Silva ------=_NextPart_000_0004_01C5DB43.20F8B870--