Re: Re: OBJECT_OPERATOR vs. DOUBLE_COLON

From: Date: Wed, 05 Jul 2017 23:46:47 +0000
Subject: Re: Re: OBJECT_OPERATOR vs. DOUBLE_COLON
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-99781@lists.php.net to get a copy of this message
Hi Andrea, Sebastian 2017-07-06 1:12 GMT+02:00 Andrea Faulds <ajf@ajf.me>: > Hi Sebastian, > > Sebastian Bergmann wrote: >> >> Is it intentional that the DOUBLE_COLON operator can be used on a >> variable that contains a reference to an object? > > > I assume so. It wouldn't be the only place that accepts either a class name > or an object of that class. Thinking about it, couldn't this have been a side effect of the "Dynamic access to static methods", available as of PHP 5.3: <?php class C { public static $foo = 123; } $a = "C"; echo $a::$foo; ?> -- regards, Kalle Sommer Nielsen kalle@php.net

« previous php.internals (#99781) next »