1--TEST-- 2Implicit initialisation when passing by reference 3--FILE-- 4<?php 5function passbyVal($val) { 6 echo "\nInside passbyVal call:\n"; 7 var_dump($val); 8} 9 10function passbyRef(&$ref) { 11 echo "\nInside passbyRef call:\n"; 12 var_dump($ref); 13} 14 15echo "\nPassing undefined by value\n"; 16passbyVal($undef1[0]); 17echo "\nAfter call\n"; 18var_dump($undef1); 19 20echo "\nPassing undefined by reference\n"; 21passbyRef($undef2[0]); 22echo "\nAfter call\n"; 23var_dump($undef2) 24?> 25--EXPECTF-- 26Passing undefined by value 27 28Notice: Undefined variable: undef1 in %s on line 13 29 30Inside passbyVal call: 31NULL 32 33After call 34 35Notice: Undefined variable: undef1 in %s on line 15 36NULL 37 38Passing undefined by reference 39 40Inside passbyRef call: 41NULL 42 43After call 44array(1) { 45 [0]=> 46 NULL 47} 48