03-01-2009, 01:44 AM
|
#3 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
Quote:
Originally Posted by allworknoplay
I assume that in PHP4 and PHP5, that arrays are passed by reference, just like objects in PHP5...is that correct?
|
No, arrays are passed by value unless explicitly passed by reference (the same way as objects were handled in PHP4). Example:
PHP Code:
$one = array('a' => 'apple', 'b' => 'banana', 'c' => 'car');
$two = $one;
$three =& $one;
$one['b'] = 'ball';
var_dump($one, $two, $three);
|
|
|
|