Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79171 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4227 invoked from network); 25 Nov 2014 17:46:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Nov 2014 17:46:24 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.179 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.214.179 mail-ob0-f179.google.com Received: from [209.85.214.179] ([209.85.214.179:62849] helo=mail-ob0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BB/5A-40624-D60C4745 for ; Tue, 25 Nov 2014 12:46:21 -0500 Received: by mail-ob0-f179.google.com with SMTP id va2so844028obc.24 for ; Tue, 25 Nov 2014 09:46:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=NrHnsMdliJjrUCUv1Bm7LdQG5zeJUM0/o9421SIa5cg=; b=QSMIz4pG0p+NBldk4dR0o7gq/KszE1/kA3L04BhvnUJi8hg9wq1/MzmoYsMEz3SdTj 10DafoQsiulcQUj7K4BBVM4hHg0UsV5eKjzg6a/Ce9Sdw6rcGBFFUyXmE6g+v0rJZLTm 2MOjNDr4PwtXg9pnYYvqcjFmFuE6HgAgz70xdU/MOhxB4zaEfHd0+1cyNzZSpQ4oKGcU dDFu2Vp/RfYoMAklG/XfB1msaGxImcu9rQuhOO2Xa3rVKUfAKyryKPUr88Vdj0B3Ht4K vpBUGwadyBrSCyCv3LUtHINK/3B6l83Hj/EPz1EOAOoacFeT/4ixWG5MUst8da7M2Dwo AXzQ== MIME-Version: 1.0 X-Received: by 10.202.74.198 with SMTP id x189mr16170928oia.50.1416937131386; Tue, 25 Nov 2014 09:38:51 -0800 (PST) Sender: morrison.levi@gmail.com Received: by 10.76.89.237 with HTTP; Tue, 25 Nov 2014 09:38:51 -0800 (PST) In-Reply-To: References: <546C9E22.6090301@fedoraproject.org> <20141119134632.GV2294@phcomp.co.uk> <546CA8C0.1060707@gmail.com> <20141119143329.GX2294@phcomp.co.uk> <1416476628.15061.4.camel@kuechenschabe> <1416502819.15061.38.camel@kuechenschabe> <1416519555.15061.43.camel@kuechenschabe> Date: Tue, 25 Nov 2014 10:38:51 -0700 X-Google-Sender-Auth: AyKzIAFoSOF7giJY7pq-L2sFScI Message-ID: To: Yasuo Ohgaki Cc: =?UTF-8?Q?Johannes_Schl=C3=BCter?= , Alain Williams , internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Remove PHP 4 Constructors From: levim@php.net (Levi Morrison) On Fri, Nov 21, 2014 at 11:20 AM, Levi Morrison wrote: >> BTW, old constructor has problem with traits (is this mentioned already?) >> >> http://3v4l.org/KZKXo >> >> I suppose nobody is using this side effect in production code, but >> there would be number of users who are confused by this behavior. > > If I remember the source code correctly, this should be considered a > bug. I will definitely look into this, regardless of the outcome of > this RFC. It turns out I was incorrect; based on the code and the phpt tests I would not say this is a bug. However, traits do check for "colliding constructors" and emit a fatal error when having both a method named after the class and a __construct method: http://3v4l.org/YHAtA. Note that it doesn't matter who declares the old and new style constructors: http://3v4l.org/ZOeoY. When defining only the same style of constructor in both there is no error: http://3v4l.org/H1jG1 and http://3v4l.org/m5D7p. I will lift this restriction in the RFC for both PHP 5.7 and 7 and update the implementation when I can.