HA: Re: [PHP-DEV] Proposal fo "Code-free constructors declaration"

From: Date: Wed, 23 Jan 2019 14:30:40 +0000
Subject: HA: Re: [PHP-DEV] Proposal fo "Code-free constructors declaration"
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-103798@lists.php.net to get a copy of this message
>> Proposed syntax >> class A($prop) extends B("BlaBla", $prop) { >> } >Would this work with anonymous classes? If so, how would the syntax look like? Currently this syntax can't be used with anonymous classes because those classes instantiated at once they declared and same syntax is used for forwarding parameters directly into constructor. new class(10) extends SomeClass implements SomeInterface { public function __construct($num) {...} } I think that it is possible to create additional rule when use "parameter_list" instead of "argument_list". Some research is required. But it will add some ambiguity when reading code.

« previous php.internals (#103798) next »