|
Posted by Oli Filth on 10/19/15 11:31
ZeldorBlat said the following on 07/11/2005 14:34:
> Not really a bug..more a difference in the way __get and __set are
> handled. Remember that when you use these, something like:
>
> $x = $obj->y
>
> does something slightly different than what you expect. Consider the
> following:
>
> function makeArray() {
> $r = array(1, 2, 3, 4);
> return $r;
> }
>
> Could you then write something like this:
>
> echo makeArray()[2];
>
> No, because makeArray is a function, not a reference or variable.
Actually, this is a limitation of PHP. In C, C++, C# and Java, the
equivalent of the above code works fine.
--
Oli
Navigation:
[Reply to this message]
|