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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to