Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23203 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5596 invoked by uid 1010); 8 May 2006 23:23:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 5581 invoked from network); 8 May 2006 23:23:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 May 2006 23:23:16 -0000 X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:33270] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 63/2C-63885-3E2DF544 for ; Mon, 08 May 2006 19:23:15 -0400 Received: from baumbart.mbo (dslb-084-063-047-027.pools.arcor-ip.net [84.63.47.27]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id 5F72A35C1C1; Tue, 9 May 2006 01:23:12 +0200 (CEST) Date: Tue, 9 May 2006 01:23:14 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <273542913.20060509012314@marcus-boerger.de> To: Thomas Moenicke Cc: internals In-Reply-To: <200605090132.11551.tm@ippfp.org> References: <200605090132.11551.tm@ippfp.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] class inheritance From: helly@php.net (Marcus Boerger) Hello Thomas, sure php is unlike c++ where everything is handled via vmt's that change during construction. In php the ctors are called after the default values are applied to every member variable. Actually the most outer ctor is being called so in your case B's. If that is calling into A's ctor which is in your case a c implementation you can easily access that member just as any other. best regards marcus Tuesday, May 9, 2006, 1:32:10 AM, you wrote: > Hi, > I have two classes, A and B: B inherits from A. B is written in PHP, A is > implemented inside of an extension. B has an array: > class B extends A > { > var $myArray = array("one", "two", "three"); > function __construct() > { > parent::__construct(); > } > } > Is it possible to access $myArray in the parents constructor? Therefor I need > the zval* pointer of the child! > I do not want to pass it as an argument. > Thanks and regards, > Thomas Best regards, Marcus