Friend posted this PHP snippet.
<?
$a=array(1,2,3);
foreach ($a as &$item){}
foreach ($a as $item){}
print_r($a);
The output is 1,2,2
- why?
Friend posted this PHP snippet.
<?
$a=array(1,2,3);
foreach ($a as &$item){}
foreach ($a as $item){}
print_r($a);
The output is 1,2,2
- why?