3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
function &myreffun($num) { return $num*$num; } $val=&myreffun(10); <?php function &globalvariables($str) { return $GLOBALS[$str]; } $number=30; $value1=$globalvariables(number); print value1."<br>"; $value1=40; print $value1."<br>"; ?>
based on 5Ye8e
Output for 7.0.0 - 7.2.0
function &myreffun($num) { return $num*$num; } $val=&myreffun(10); Notice: Undefined variable: globalvariables in /in/LsKKq on line 12 Fatal error: Uncaught Error: Function name must be a string in /in/LsKKq:12 Stack trace: #0 {main} thrown in /in/LsKKq on line 12
Process exited with code 255.
Output for 5.3.17 - 5.6.28
function &myreffun($num) { return $num*$num; } $val=&myreffun(10); Notice: Undefined variable: globalvariables in /in/LsKKq on line 12 Fatal error: Function name must be a string in /in/LsKKq on line 12
Process exited with code 255.