Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78964 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49453 invoked from network); 18 Nov 2014 22:57:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2014 22:57:05 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.180 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.180 mail-wi0-f180.google.com Received: from [209.85.212.180] ([209.85.212.180:36369] helo=mail-wi0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3F/C7-06737-EBECB645 for ; Tue, 18 Nov 2014 17:57:03 -0500 Received: by mail-wi0-f180.google.com with SMTP id n3so6927507wiv.13 for ; Tue, 18 Nov 2014 14:56:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=IPH9b4B9y9a4JXALil1DV4AGxMFYoQX4uYueoM3Gvzo=; b=df9cCuXh8ZnGbOR9ZUvMUqu7Pnkm1PYKhW92xvPSPidYBJA6Pk26AUwtwTQ9v2Y1fs q0hT3hAOnS7J4bRTGdMAUbkxHxUQHbBy6+d63C99EpvmHUoOchQ64FKNf9riwDL2Lm9Z njdJRVezPPEvwdv9MOWTcUMrahlit0Wkv2/12/YzIC05yYLYC++1mVddPY2KUEUX7NQw qulB8dOMOm98yjdl6zWZLc3dVHFNf+fp1VGi1XrzSJHzjTrfeOOQOuKlNyuRuKgHuvW9 zByN0csJeXIYs755eolrJxLKCXOVsM9hKilxmaoEfBcUcNJwozlcEzEfd6ExVX5GnK3G ucjA== X-Received: by 10.194.77.142 with SMTP id s14mr52926023wjw.94.1416351419756; Tue, 18 Nov 2014 14:56:59 -0800 (PST) Received: from [192.168.0.2] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id ge17sm706927wic.0.2014.11.18.14.56.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Nov 2014 14:56:59 -0800 (PST) Message-ID: <546BCEA9.5060004@gmail.com> Date: Tue, 18 Nov 2014 22:56:41 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: internals@lists.php.net References: <546B0F62.1090705@gmail.com> <546B95F2.2050504@gmail.com> <546BBF4F.8040806@gmail.com> <919EDD0D-F0F4-430A-A84B-96A32DF45E7B@ajf.me> In-Reply-To: <919EDD0D-F0F4-430A-A84B-96A32DF45E7B@ajf.me> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Default constructors From: rowan.collins@gmail.com (Rowan Collins) On 18/11/2014 21:53, Andrea Faulds wrote: >> On 18 Nov 2014, at 21:51, Rowan Collins wrote: >> >> Personally, I would much prefer the backwards compatibility break to happen. It is frankly quite bizarre, and not at all useful, that the following two pieces of code behave differently: >> >> class Foo {} >> new Foo( print('hello') ); >> // silent >> >> vs >> >> class Foo { function __construct() {} } >> new Foo( print('hello') ); >> // says "hello" >> >> (Incidentally, HHVM doesn't have this "optimisation", and says "hello" in both cases: http://3v4l.org/ZDXs1) >> >> If I came upon this without knowing more, I would assume it was a bug in PHP, and any code relying on it was in need of fixing ASAP. > In fact, it *is* a bug: https://bugs.php.net/bug.php?id=67829 Or, depending on who looks at the report, it's Not A Bug: https://bugs.php.net/bug.php?id=54162 But, yes, I would argue that both reports are actually valid, and this behaviour, however long-standing, is an accident of implementation, not a design decision that anyone can actually justfiy. Regards, -- Rowan Collins [IMSoP]