Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78985 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9363 invoked from network); 19 Nov 2014 09:13:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Nov 2014 09:13:12 -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 74.125.82.44 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.44 mail-wg0-f44.google.com Received: from [74.125.82.44] ([74.125.82.44:58284] helo=mail-wg0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FE/B3-15277-62F5C645 for ; Wed, 19 Nov 2014 04:13:12 -0500 Received: by mail-wg0-f44.google.com with SMTP id b13so243135wgh.17 for ; Wed, 19 Nov 2014 01:13:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type:subject:from:date:to:cc :message-id; bh=05DEb8SNfUtf433uAP4pFMAozfGsV8gRzh4hl254EE0=; b=yIL+vDAyocBjef+poa2r2TRJtaioXzUVGoNqWo2egHF1d8E3PYAnUBJiaBq8o50pXM DEJwaRlreUiNJFpq63J7imcBF+skIDHPwUsdaM8Sl8WsTKiPdfdnp98jDzUXJPM+hmmJ QFoUCgscJrI6jLkSpB1+yvPJKZgHt8AS6ldvkEPW1xxoo3D22xir66h4ECGdG8aBPbxP uYBFLQOmNhmmFkNBwAmHg/JWkxHUh+bHQt6wjKI6cWKZW1/CYvKcrMzv4JEsFOKeVhRm RRvLfdzYBsXwyrykWtoCLVb1K9UEZ01mvrEY3yYkpU+k3ScLmWF2N7ua3qqgnzQj1x0E MJZg== X-Received: by 10.194.95.200 with SMTP id dm8mr10785557wjb.133.1416388387735; Wed, 19 Nov 2014 01:13:07 -0800 (PST) Received: from [192.168.0.3] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id w5sm1329792wif.18.2014.11.19.01.13.06 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Nov 2014 01:13:07 -0800 (PST) User-Agent: K-9 Mail for Android In-Reply-To: <546BF769.9090408@gmail.com> 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> <546BD451.4070909@gmail.com> <546BDEAE.2010102@gmail.com> <546BF769.9090408@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Date: Wed, 19 Nov 2014 09:11:50 +0000 To: Stanislav Malyshev ,Marco Pivetta CC: PHP Internals List Message-ID: <527A5390-FA8A-4EC8-8E3F-EA3364C136CA@gmail.com> Subject: Re: [PHP-DEV] [RFC] Default constructors From: rowan.collins@gmail.com (Rowan Collins) On 19 November 2014 01:50:33 GMT, Stanislav Malyshev wrote: >Hi! > >> Is there a `.phpt` test-case or discussion backing this? > >Backing what? Checking if side effects happen when evaluating args of >non-existing ctor? Probably not, since nobody ever needed it (correct >me >if I'm wrong). Quite: nobody ever needed, or expected it, or intended it. > There are many weird scenarios of what you could do with >PHP that are not covered by tests because nobody ever thought anybody >would care to know what happens if you do that. Fine. And some of those edge cases, when tested, do the wrong thing. Those are bugs. >But I don't need tests to conclude it's intentional behavior - plain >look at the code shows it very clearly, you don't make special case in >ZEND_NEW to skip the ctor method call and write all the code around it >if you don't mean to make special case to do just that. I still don't have enough understanding of the engine to follow the argument here. That the engine skips code to dispatch to a non-existent __construct method doesn't seem on the face of it proof that lazy evaluation of its arguments was intended. It sounds more like an implementation detail that skipping a function dispatch also happens to skip evaluation of those expressions. There is nowhere else in the language which lazily evaluates the arguments of a function based on the content of that function. Unused parameters, including those passed to an empty constructor, are always evaluated. I'm not sure why you're treating a parameter expression with side effects as something exotic.