Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8338 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38391 invoked by uid 1010); 3 Mar 2004 10:37:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 38250 invoked from network); 3 Mar 2004 10:37:49 -0000 Received: from unknown (HELO fep22-app.kolumbus.fi) (193.229.0.60) by pb1.pair.com with SMTP; 3 Mar 2004 10:37:49 -0000 Received: from ipana ([80.186.222.174]) by fep22-app.kolumbus.fi with SMTP id <20040303103742.LAJU3524.fep22-app.kolumbus.fi@ipana> for ; Wed, 3 Mar 2004 12:37:42 +0200 Message-ID: <002701c4010b$a37f3f30$aedeba50@ipana> Reply-To: "Erkka Marjakangas" To: References: <001001c40104$7d1cc170$aedeba50@ipana> Date: Wed, 3 Mar 2004 12:38:07 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Subject: Re: [PHP-DEV] Getting parent constructor called in a class chain - PHP 4.3.4 C extension From: ede@iki.fi ("Erkka Marjakangas") Yiihaa, it does work! Thanks a million! ----- Original Message -----=20 From: "Derick Rethans" To: "Erkka Marjakangas" Cc: Sent: Wednesday, March 03, 2004 11:58 AM Subject: Re: [PHP-DEV] Getting parent constructor called in a class = chain - PHP 4.3.4 C extension > On Wed, 3 Mar 2004, Erkka Marjakangas wrote: >=20 > > Hello! > > > > Not sure if this is the most proper place for discussing PHP > > extensions, so blame me if I'm in a totally wrong place here ;-) >=20 > It is :) >=20 > > How do I tell PHP (4.3.4) / Zend engine to automatically call parent > > constructors when creating a class that has parents in an extension? > > > > Or if it cannot be done automatically, what would be the way to call > > the parent constructor? >=20 > It is not done automatically >=20 > > ZEND_FUNCTION(stringitem) > > { > > //TODO: should I call item ctor manually here, if so, how? = Can't it be automated? > > add_property_string(this_ptr, "stringitem_str", = "ThisIsStringItemClass",1); > > } > > ... > > ---Code--- > > > > I can always isolate the constructors to their own functions and = call > > them manually in appropriate places to get properties of the parent > > class(es) initialized, but it sounds like a kludge and I' sure = there's > > an automated way to do this since methods get inherited.... >=20 > There is no automated way for that, but what you can do is adding: >=20 > zif_item(INTERNAL_FUNCTION_PARAM_PASSTHRU); >=20 > at the locattion of "TODO". This *might* work. > (Please also note that it is always smart to prefix your > functions/classes with the extension name to prevent naming clashes).. >=20 > Derick >