Relative Content

Tag Archive for phpreference

PHP References, Functions and Arrays

<?php $array = [[‘Example’ => ‘Value’]]; function hello(&$array) { foreach ($array as &$member) { $member[‘Test’] = true; } } var_dump($array); Consider the above. Why is it that ‘Test’ => true is not added to the array member [‘Example’ => ‘Value’]? I’ve passed references down the line, so $member should be a name referring to the […]