Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54209 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97143 invoked from network); 26 Jul 2011 11:31:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jul 2011 11:31:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.21 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.21 smtp1.ist.utl.pt Linux 2.6 Received: from [193.136.128.21] ([193.136.128.21:38545] helo=smtp1.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/51-18504-F75AE2E4 for ; Tue, 26 Jul 2011 07:31:12 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.ist.utl.pt (Postfix) with ESMTP id D4BE370003C7 for ; Tue, 26 Jul 2011 12:31:08 +0100 (WEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp1.ist.utl.pt ([127.0.0.1]) by localhost (smtp1.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id IvW4maCz2Z3j for ; Tue, 26 Jul 2011 12:31:08 +0100 (WEST) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp1.ist.utl.pt (Postfix) with ESMTP id 91EF370003C4 for ; Tue, 26 Jul 2011 12:31:08 +0100 (WEST) Received: from clk-0081.mshome.net (unknown [85.139.253.17]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id 6CA062007317 for ; Tue, 26 Jul 2011 12:31:08 +0100 (WEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "internals@lists.php.net" References: Date: Tue, 26 Jul 2011 12:31:07 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_I=2ES=2ET=2E?= Message-ID: In-Reply-To: User-Agent: Opera Mail/11.50 (Win32) Subject: Re: [PHP-DEV] Re: [Patches]#36944, #54556, #55211(and svn karma applying) From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") Em Tue, 26 Jul 2011 12:14:15 +0100, Laruence escreveu: > 2011/7/26 Gustavo Lopes : >> Em Tue, 26 Jul 2011 06:42:50 +0100, Laruence >> escreveu: >> >>> 2011/7/25 Laruence : >>>> #54556 array access to empty var does not trigger a notice >>>> https://bugs.php.net/bug.php?id=54556 >> >> Won't this be affected? >> >> > $foo[] = 'bar'; >> > no, this situation won't be affected Ah, if this is only for read situations, a notice seems appropriate. >>> #55128 SplFixedArray::fromArray() does not use extended class >> >> This doesn't look like a good idea. The constructor is not called (and >> in general can't be, since we can't know how the subclass constructor >> looks >> like), so the new object can be in an illegal state. >> > After much thought, I think there maybe no reason for fixedarray > extended class to define it's own constructor, since we provide > fixedarrary::__construct and fromArray already, and extended class > should only get an instance through calling them. > > so I think we can make fixedarray::__construct final to make this > feature works. I disagree. Besides being a BC break, there's no good reason to make the constructor final and it has the disadvantage of severely limiting the subclasses. Instead of using LSB, I think a better option would be to provided a protected final instance method that would do this special form of initialization from an array. Subclasses could then write their own static method (possibly with the same name) for initializing from an array or even accept an array as a constructor argument. This is a bit more work and less magic than LSB, but much more versatile. -- Gustavo Lopes