3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $aa = 'str2'; function def_vars(){ $a = 'str'; $b = 2; return _R(array()); } function _R($return){ $vars = get_defined_vars(); var_dump($vars); return $return; } echo def_vars(); //var_dump(get_defined_vars());
based on YfiBf
Output for 5.4.0 - 7.3.0rc4
array(1) { ["return"]=> array(0) { } } Notice: Array to string conversion in /in/dU7Gt on line 15 Array
Output for 4.3.0 - 5.0.5, 5.1.1 - 5.3.29
array(1) { ["return"]=> array(0) { } } Array
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/dU7Gt on line 16
Process exited with code 255.