Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97757 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68120 invoked from network); 14 Jan 2017 21:01:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2017 21:01:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=michal@brzuchalski.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=michal@brzuchalski.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain brzuchalski.com designates 188.165.245.118 as permitted sender) X-PHP-List-Original-Sender: michal@brzuchalski.com X-Host-Fingerprint: 188.165.245.118 ns220893.ip-188-165-245.eu Received: from [188.165.245.118] ([188.165.245.118:47559] helo=poczta.brzuchalski.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/D9-00729-4919A785 for ; Sat, 14 Jan 2017 16:01:09 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by poczta.brzuchalski.com (Postfix) with ESMTP id D32042984236 for ; Sat, 14 Jan 2017 22:01:05 +0100 (CET) Received: from poczta.brzuchalski.com ([127.0.0.1]) by localhost (poczta.brzuchalski.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zqpnOEFC1MoE for ; Sat, 14 Jan 2017 22:01:01 +0100 (CET) Received: from mail-vk0-f44.google.com (unknown [209.85.213.44]) by poczta.brzuchalski.com (Postfix) with ESMTPSA id 406A12984233 for ; Sat, 14 Jan 2017 22:00:59 +0100 (CET) Received: by mail-vk0-f44.google.com with SMTP id r136so53451996vke.1 for ; Sat, 14 Jan 2017 13:00:59 -0800 (PST) X-Gm-Message-State: AIkVDXKHebiTL429FcVA8wY8enetWmLmkRPb99qLEE0E9+ZajDeM8RjNsc6du9iQ108HElFgRd1amEOiSlb/2Q== X-Received: by 10.31.238.6 with SMTP id m6mr11046253vkh.28.1484427658717; Sat, 14 Jan 2017 13:00:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.35.204 with HTTP; Sat, 14 Jan 2017 13:00:57 -0800 (PST) In-Reply-To: References: <0DE25BF8-D349-48EF-A83B-8837DD4AD1E0@gmail.com> <5efcc230-c67b-4439-cc82-b31eacbf36db@php.net> <7c8c8801-a849-6fd2-91e9-954030c55e83@fleshgrinder.com> <2051639b-1b63-2e44-51b0-381caa54dfd0@fleshgrinder.com> Date: Sat, 14 Jan 2017 22:00:57 +0100 X-Gmail-Original-Message-ID: Message-ID: To: PHP Internals List Cc: Giovanni Giacobbi Content-Type: multipart/alternative; boundary=94eb2c1497144af5990546143f52 Subject: Re: [PHP-DEV] Explicit constructor call and polymorphic dispatch From: michal@brzuchalski.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=) --94eb2c1497144af5990546143f52 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2017-01-14 19:24 GMT+01:00 Fleshgrinder : > On 1/14/2017 7:10 PM, Micha=C5=82 Brzuchalski wrote: > > AFAIK parent is a speciual scope which help refers to variables and > > functions in base classe > > http://php.net/manual/kr/keyword.parent.php > > So it looks like proposing your syntax could lead to huge BC break. > > In other languages (eg. Java) there is special syntax quite similar wit= h > > `super($a, $b)` call. > > > > `super` **is** Java=E2=80=99s `parent` keyword. > > There is definitely no breaking change here by enabling `parent()` as an > alternative to `parent::__construct()` since it has no functionality at > all right now. As a matter of fact, PHP currently aborts with a fatal > error: > > ``` > Fatal error: Call to undefined function parent() in > ``` > > Reversing keywords in the global scope is done regularly in PHP minor > versions, hence, that would not be a problem either. > > I see only one single problem, users might expect that `parent()` > actually should call `parent::__invoke()`. However, that is not the case > right now and nobody ever asked for it plus it is a little used feature > anyways which does not require special treatment (imho). > > There might be different parent scope calls not only to magic method but also all base class methods. > Regarding the fatal error on a missing constructor implementation in the > parent. I fully agree that this should be possible. > > -- > Richard "Fleshgrinder" Fussenegger > --=20 regards / pozdrawiam, -- Micha=C5=82 Brzuchalski about.me/brzuchal brzuchalski.com --94eb2c1497144af5990546143f52--