Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52402 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32142 invoked from network); 16 May 2011 18:44:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2011 18:44:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=andrewcurioso@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=andrewcurioso@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: andrewcurioso@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vx0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:44449] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9B/FF-26716-A8071DD4 for ; Mon, 16 May 2011 14:44:27 -0400 Received: by vxb40 with SMTP id 40so4075323vxb.29 for ; Mon, 16 May 2011 11:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=JA4aC1RS24qTQCWx8ZXJ07RyzVAwv7bc+nEGcgoYFIA=; b=HDjHrtAYTEJ4CvUrrAMdf/GiI9tsGGZ9vq9aqmndX3Sa7CyxuIDyhyLdIC0oqNhznX q7AbURzDzEd/TaLowGxW2alDUzPpp8/62fckAKbvnym8xaWYi0qquFvd08YTAjmdNBSu bovFj56FYv0ReqvvgumMNamlHR4cZJcVJ0HnY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=aT49TeclJtylwx+NH1qGfuO7kBZuu7a/iLo+dxC0hw2xuWBLndaIuO3foCKBRJxM9L 429UKc1Cwd3Ft5KNmudBRss6TYBIVhh/jlPnps7JUdkp/typcDF6xDK9wJVVMP2yZmtx orJTqzFb1ylNCg/kU7oYRxaHdiiEcOvL+DFQE= MIME-Version: 1.0 Received: by 10.52.187.194 with SMTP id fu2mr6288697vdc.258.1305571463766; Mon, 16 May 2011 11:44:23 -0700 (PDT) Received: by 10.52.101.167 with HTTP; Mon, 16 May 2011 11:44:23 -0700 (PDT) In-Reply-To: <1305570720.1344.535.camel@guybrush> References: <1305570720.1344.535.camel@guybrush> Date: Mon, 16 May 2011 14:44:23 -0400 Message-ID: To: =?ISO-8859-1?Q?Johannes_Schl=FCter?= , smalyshev@sugarcrm.com Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=bcaec548a11753a2ae04a3690ba1 Subject: Re: [PHP-DEV] Inconsistencies with constructors in SPL From: andrewcurioso@gmail.com (Andrew Curioso) --bcaec548a11753a2ae04a3690ba1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I like that idea and I like that it works for userland classes as well. +1 Do you think it should throw a warning, notice, or -- as you both suggested -- just silently succeed? 2011/5/16 Johannes Schl=FCter > Hi, > > I|d actuallz suggest a different option: > > If a parent constructor is called but doesn't exist the engine should > ignore this. The same goes for destructors. > > This solution would also work for userland classes. > > johannes > > On Mon, 2011-05-16 at 14:14 -0400, Andrew Curioso wrote: > > So, I ran across bug #54631 > > > > A fatal error is thrown if you try to call parent::__construct() from a > > subclass > > of SplObjectStorage. > > > > I was going to close it as "expected behavior" since that is pretty > normal > > if the parent class doesn't implement __construct(). > > Also, the docs don't list it as having a __construct() method. > > > > But then look at SplDoublyLinkedList (and a bunch of others). They are > > documented > > as having a __construct() method, yet it triggers a fatal error when yo= u > try > > to call > > "parent::__construct()" from a subclass' constructor . > > > > So it seems to me that there are two possible solutions: > > > > - Update the docs to remove ::__construct() for classes that don't have > one. > > - Make sure __construct() is implemented in all SPL classes * and updat= e > the > > docs. > > > > * Even if it is empty. > > > > What's everyone thinking? > > > > I'd be more than happy to add the constructors to the code where needed= , > I > > just > > want to make sure that it is the right move first. > > > > > > - Andrew > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --bcaec548a11753a2ae04a3690ba1--