Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101882 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68733 invoked from network); 17 Feb 2018 14:40:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2018 14:40: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.128.182 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.128.182 mail-wr0-f182.google.com Received: from [209.85.128.182] ([209.85.128.182:39928] helo=mail-wr0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D3/83-26725-4CE388A5 for ; Sat, 17 Feb 2018 09:40:05 -0500 Received: by mail-wr0-f182.google.com with SMTP id w77so5488724wrc.6 for ; Sat, 17 Feb 2018 06:40:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=9+Qpz5ZCkgLCRFlRy2KqHH9icIrKfrimetLHfGm2SHY=; b=XNJAtVX0vDZk0LO0DkpT6GTk+E2qjoHqAaBIeOFtUdogsBRGeNZEST+OKZbusHN3vs ytKWsCWniS4utuBZnY+Q8OzNX0J21owrWOkCYFY1eM61oG12TXWH/SMmQtFkL5jwK60c rN2qV0xqvXSs+tkN4jcciQLqf1qRkEpSvpsHaNIeXC4PaA2vFvpOpMSdTnBV8Z9PcKmU 1/wCGZ0J+1TgM7jkWyvhp+aIiadRAseH65i3cuI5u/ZHRDUocz7h0oaKUBVOhVlJiZob O1iqvcpuHG5e9tuF7Wzk2NuRSMnaYODcyJBbLiStt+zai6ZfK7TzqgJI2eyWGzH7OUld aFyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=9+Qpz5ZCkgLCRFlRy2KqHH9icIrKfrimetLHfGm2SHY=; b=ruGnXGSEcex4MHN2PslW0ZfGdYL/10Fg0INmrtZo7G/orP3sf3B2sFF/XzH8R4Do3D 1r7cMMglEZVWhKJWE5TB7SV6tolJElYlGN8qrf4MrRQLZHLPuRdU7RXo56xgMrxA8dD8 fKEHw9qYlghr5n3f/GvsPJBPwlYOtSoxQ0ve8qtxtaCFOWCzqkHEP53NHvQysL2T7X50 mY/b7yBcigqwo6j4DTtg+sX537y6B5bkab/z5CAdZ7gPDpV5rc5ALfRsRkSu4NtbjpKx c7Hgltmpu1v5KGjhLig3q29IXJYihw19aOLC2+XAQaKVS4aDfL7rbAxaB8oIifh9Z+W1 5xZw== X-Gm-Message-State: APf1xPCM+qCIfyKOY1k/0FgRG/MgEC9aHqo1rOikP3kl9PKTKUSBW2gD 4HNTTRg5xM/jOr/AE9/FFYMCiBzz X-Google-Smtp-Source: AH8x226qTesanYPDhNRnGRRYHZjavEvjAQpPTcJC4tz1WrymxMHAnP6D/BcrY5jp7xHk2B/N7w0Ayg== X-Received: by 10.223.199.148 with SMTP id l20mr7775244wrg.117.1518878401068; Sat, 17 Feb 2018 06:40:01 -0800 (PST) Received: from [10.61.138.47] (188.29.165.127.threembb.co.uk. [188.29.165.127]) by smtp.gmail.com with ESMTPSA id q195sm18721259wmb.33.2018.02.17.06.39.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Feb 2018 06:39:59 -0800 (PST) Date: Sat, 17 Feb 2018 14:39:55 +0000 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: internals@lists.php.net Message-ID: <187595BB-5D82-4989-9C30-1E0A862F04C3@gmail.com> Subject: Re: [PHP-DEV] Suggested change: change priority of new and -> From: rowan.collins@gmail.com (Rowan Collins) On 8 February 2018 18:38:36 GMT+00:00, Mcmuffin Mcguffin wrote: >Hi, > >It's a common idiom in object-oriented languages to create an object >and >then immediately call a method on it, such as (in C# or Java): > >new DateTime ()=2EToString () > >However, PHP grammar does not work this way=2E This would definitely be nice to have, and thanks for looking into what th= e necessary change would look like=2E I think the next challenge is to work out the different ways a dynamic cla= ss construction could happen, and which ones: a) will be unaffected by the change b) are an error now and will be allowed after c) are allowed now and will be an error after d) will work in both versions but change behaviour It's anything that falls into category (d) that is particularly problemati= c, as it means users will see odd bugs of they don't know about the change= =2E The clearer we can make these examples, the better=2E Contrary to other responses, I think this would definitely need to happen = in a major version, as it is quite clearly a breaking change=2E There's not= much that can be done to deprecate code relying on the current rules, but = we can publicise how to make code that is compatible before and after=2E Regards, --=20 Rowan Collins [IMSoP]