I noticed that in PHP extract(some_function()); will work just like:
$stuff = some_function();
extract($stuff);
But in the PHP’s documentation the extract function argument has the & thingy in front, and from what I know that means you have to pass a variable to it.
If the documentation was right, this would produce a strict standards message:
So I think you just found a bug in the documentation. Congratulations.
EDIT
It still doesn’t complain if you use it with
EXTR_REFSas a second argument:Which is strange because referencing variables defined inside a function doesn’t make much sense to me. I think the & might have been introduced because of this option, but appears only in the doc and is not enforced in the code.
EDIT
It seems I’m right, I found this comment in
ext/standard/array.c(branches 5.3 and 5.4):