Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91643 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76347 invoked from network); 12 Mar 2016 17:27:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Mar 2016 17:27:49 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.217.176 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.217.176 mail-lb0-f176.google.com Received: from [209.85.217.176] ([209.85.217.176:36469] helo=mail-lb0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 37/E6-14237-59154E65 for ; Sat, 12 Mar 2016 12:27:49 -0500 Received: by mail-lb0-f176.google.com with SMTP id x1so192571444lbj.3 for ; Sat, 12 Mar 2016 09:27:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=eVT232OgKi0nsoKhKsJ+U/QWyi2I8SpYi2aw0PGRToo=; b=oN1JPZgCWF1MN5VOKgDkzfx5hSDVBDVt9frMPKnktA9RtMzhtgvCNhRE9Y8N/5iC90 H44o3xJ2xyaSt2VvbTN4y2F4ZNC9OoaUJbgMr/B/fWcODVjBWSX4h1BpXvzwCQK0Sgtk VdQITZHzwAf2O9i6PJsFsa8+CC2QgB5Wr4amD9mF+LSxY02ZIhE1gf7lzpF5cjJ4GZvn i1WWulsox3O0jdA0e3pNcUt9bDPkPF/LekaJFYrP5xbvTfoQdLbcgyDb7H5a44rkGHv0 S832Xs5aAtTz7uN5HQ14RVGu6D07L2gl2Epr0kGhdcqpsV2U134U6PUIAsqiYt0DPwwp 2F2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=eVT232OgKi0nsoKhKsJ+U/QWyi2I8SpYi2aw0PGRToo=; b=ksGxZ5yoFpzxDF2gNxEv3Q0YZvE5M1O3toK5NlRiGV2UoImNo+qbhKG0CGyAKlrX7V GXCD7lEKh02eoVFTltQt6pnIeYHMDRicnySxL5cefn8YieQUPp8epSquoq+TeYpB2rAa 3GLh0ZncAiKdZ+0lUPAwPJMKweRI8E/HPdkZUQMQ/rZ7o27h6SybzG3dRo10EyPfn1/U qIdxeBKF8qhxQ4MGNiQjS1zY6vBPowBQh+HFduWp7U+cSfBRenXrpjjBEOa31KlOYgHt 3JzsRUGvIC3pe725w1NOuKai074aYxZG3NLO2hw6qvvJkrrmcmmSk2y9iT1eOpMCXj0u 8r+A== X-Gm-Message-State: AD7BkJIZvp3kjyLYtmWz9+IJl8V3Xn/D1JX+6iXXD4zw2OP5wIMxy3M9lVSmeLUvw4CLdlmS7pXomaWdbBjXYQ== MIME-Version: 1.0 X-Received: by 10.25.158.136 with SMTP id h130mr5229278lfe.108.1457803666112; Sat, 12 Mar 2016 09:27:46 -0800 (PST) Sender: php@golemon.com Received: by 10.112.18.75 with HTTP; Sat, 12 Mar 2016 09:27:45 -0800 (PST) X-Originating-IP: [107.198.91.68] In-Reply-To: References: Date: Sat, 12 Mar 2016 09:27:45 -0800 X-Google-Sender-Auth: e3ErSkORwcPmLyG0D5B5aLL5F0o Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Evaluate arguments of new for classes without constructors From: pollita@php.net (Sara Golemon) On Sat, Mar 12, 2016 at 8:01 AM, Nikita Popov wrote: > class Foo {} > new Foo(print 'xyz'); > > will not print "xyz", because the arguments to "new" are not evaluated if > the class has no constructor. Conversely > I recall someone once dubbing this "The Rasmus Optimization". I don't know if that means it was intentional, or just a lazy jibe, but yeah. It's a long known issue, so it's probably good that you posted about it first, as someone may have a legit reason for not wanting to fix it. (I don't, I regard this as a php sadness) > HHVM does not implement "new" in this way, they always evaluate the arguments. > Which, if it helps, means that we already know a lot of frameworks /don't/ break as a result of fixing this behavior. > As this is technically a BC affecting change (even if of the lowest > impact), I'm running it past the list first. > Technically a BC break that justifies waiting till a major version. Given the extremely specific requirements to hit this edge case however, passing side-effect args to a non-existent constructor, I personally think a minor version is fine. +1 (without having looked at the patch) -Sara