View Single Post
Old 03-01-2009, 01:44 AM   #3 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by allworknoplay View Post
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); 
Salathe is offline  
Reply With Quote
The Following User Says Thank You to Salathe For This Useful Post:
allworknoplay (03-01-2009)