
December 5th, 2012, 03:07 PM
|
 |
pollyanna
|
|
Join Date: Jul 2012
Location: Germany
|
|
Hi,
this is a misunderstanding. Passing by reference works like it always did, but you have to declare the reference in the function definition, not the function call:
PHP Code:
<?php
function f(&$x) {
$x[0] = 'x';
}
$str = 'abc';
f($str); // no, not f(&$str)
echo $str;
Last edited by Jacques1 : December 5th, 2012 at 03:12 PM.
|