Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78971 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60324 invoked from network); 18 Nov 2014 23:21:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2014 23:21:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.41 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wg0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:36155] helo=mail-wg0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/3A-06737-664DB645 for ; Tue, 18 Nov 2014 18:21:10 -0500 Received: by mail-wg0-f41.google.com with SMTP id y19so9853665wgg.0 for ; Tue, 18 Nov 2014 15:21:07 -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=R7n01xQ/09+0njO2nULfw7piWBAV+DwIOLxWWei4PWU=; b=q9te4Cm+iMgrSliTF33S2nxxtSkjmAcOolOqN6DryQ9VGYsjixNjTxhm3xgRtcJOeo esnhloOiNpHlGPxPJAoZHHtpiivphdtmbH2HM5tiOXwtL3u9D6cpRF5RviH06/0SvFep kSB2nutnqVDT7CBglNKvyqBrHS+e/7KVUTqOpXrZ29UZDqYeHpxScYognpzoxeRUcpAy GC1eFZw6RtrCgNtyFpqRr6EPMiRUEVaTkeZ/nHydgXUSGHkJya8AI05BpkjeHaMVGlyK Dlbux7uBHr21J9LcviKxFeHMu9mS4/zoYfIgmTticfKun9Kn7sJSXN/oP0L5NvoOv1JO NPtQ== X-Received: by 10.194.52.68 with SMTP id r4mr52517847wjo.82.1416352867916; Tue, 18 Nov 2014 15:21:07 -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 n3sm14553418wjz.21.2014.11.18.15.21.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Nov 2014 15:21:07 -0800 (PST) Message-ID: <546BD451.4070909@gmail.com> Date: Tue, 18 Nov 2014 23:20:49 +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> <546BCE21.7080403@gmail.com> <546BD0E8.6020609@gmail.com> <546BD206.9040800@gmail.com> In-Reply-To: <546BD206.9040800@gmail.com> 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 23:11, Stanislav Malyshev wrote: >> "Been in PHP for a very long time" != "how it was intended to work". Can >> >you explain why this would be the intention of anyone designing the >> >language? > Of course, been for a long time is not the same as intended. But if you > look at how ZEND_NEW is done, it's clear it's intended. And the reason > is simple - if there's no function, it's not really possible to initiate > a function call and handle it properly, since the engine expects certain > data there and there's nothing to provide that data. So, ZEND_NEW having > no function just skips the whole function call thing altogether. > This is where I struggle: to me, the "++$b" in "foo(++$b)" or "new Foo(++$b)" isn't part of the function call; it's a statement that has to be evaluated *before* the function call can happen. If a fatal error is being raised, it makes (some) sense to skip that evaluation, but if execution is continuing, it seems perfectly natural for that expression to be evaluated even if its result is discarded. > If you think the decision was wrong and it can be done better > - cool, let's see the patch. I'm happy to accept that this is a low-priority, hard-to-fix, bug. I just don't see that it can be justified as a feature. -- Rowan Collins [IMSoP]