Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97756 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62011 invoked from network); 14 Jan 2017 18:24:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2017 18:24:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 77.244.243.85 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.85 mx104.easyname.com Received: from [77.244.243.85] ([77.244.243.85:47554] helo=mx104.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BF/49-00729-EDC6A785 for ; Sat, 14 Jan 2017 13:24:31 -0500 Received: from cable-81-173-135-7.netcologne.de ([81.173.135.7] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1cST06-0003JI-Nd; Sat, 14 Jan 2017 18:24:27 +0000 Reply-To: internals@lists.php.net 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> To: =?UTF-8?Q?Micha=c5=82_Brzuchalski?= , Giovanni Giacobbi Cc: PHP Internals List Message-ID: Date: Sat, 14 Jan 2017 19:24:24 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-DNSBL-PBLSPAMHAUS: YES Subject: Re: [PHP-DEV] Explicit constructor call and polymorphic dispatch From: php@fleshgrinder.com (Fleshgrinder) On 1/14/2017 7:10 PM, Michał 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 with > `super($a, $b)` call. > `super` **is** Java’s `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). Regarding the fatal error on a missing constructor implementation in the parent. I fully agree that this should be possible. -- Richard "Fleshgrinder" Fussenegger