3v4l.org

run code in 300+ PHP versions simultaneously
<?php function &test($a) { $empty = array(); return isset($a) ? $a : $empty; } function &test2($a) { $empty = array(); return ${isset($a) ? 'a' : 'empty'}; } $test =& test('123'); print_r($test); $test =& test2('123'); print_r($test); $test =& test(NULL); print_r($test); $test =& test2(NULL); print_r($test);

preferences:
54.47 ms | 402 KiB | 5 Q