Re: RFC: constructor argument promotion
| From: | Stas Malyshev | Date: | Thu, 08 Aug 2013 01:05:17 +0000 |
| Subject: | Re: RFC: constructor argument promotion | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-68412@lists.php.net to get a copy of this message | ||
Hi!
> Type hints continue to work as is:
>
> class Foo {
> public function __construct(public stdClass $foo, protected array $bar =
> null) {}
> }
This is both very confusing syntax (since this would be only place in a
language where public and type name can be mixed in the same construct)
and it would imply that is somehow guaranteed that $foo is of type
stdClass, which is actually not guaranteed at all.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227