All Questions
Tagged with php-internals pass-by-reference
2
questions
5
votes
1
answer
1k
views
Why does PHP allow passing a literal to a pass-by-reference parameter in one case but not others?
The function array_shift() takes one parameter by reference. Passing an array literal causes a fatal error:
$ php -r 'var_export(array_shift(array("Test #0"));';echo
Fatal error: Only ...
1
vote
3
answers
332
views
In PHP, when $foo = new Foo(), technically speaking, is $foo an object, or is $foo a reference?
Update: in
http://php.net/manual/en/language.oop5.references.php
it says:
One of the key-points of PHP5 OOP that
is often mentioned is that "objects
are passed by references by default".
...