Le 28 mai 2022 11:44:13 GMT+02:00, Ilija Tovilo <[email protected]> a
écrit :
>Hi everyone
>
>I'd like to start a discussion on a simple RFC to allow fetching
>properties in constant expressions.
>https://wiki.php.net/rfc/fetch_property_in_const_expressions
>
>The RFC proposes adding support for fetching properties in constant
>expressions using the -> operator. I'm looking forward to your
>feedback.
It is not clear to me why this allows using -> on enums but not on other
objects.
Can you clarify why the following is not allowed:
<?php
$a = new Thing();
class C
{
protected $b = $a->var;
static $staticobj = new Thing();
function f($p = self::$staticobj->var) {}
}
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php