Code: Select all
$a = array("cat", "dog");
echo count($a);
Test($a);
Code: Select all
function Test(&$array){
echo count($array);
}
count()
statements show 2 and -1.This happens whether I pass the array by value or by reference.
What is wrong with my code, please?