3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $globalVar = 'Hey I\'m global'; function getAllArgs(&$globalVar1) { /* if(func_num_args() > 0) { foreach(func_get_args() as $arg => $value) { echo $arg. ' ' . $value; } }else { echo 'No arguments given';__construct } */ $globalVar1 = 'Now I\'ve been modified by the function.'; } echo "Here is the argument BEFORE we modify it:" . $globalVarClosure; getAllArgs($globalVar); echo "Here it is AFTER:" . $globalVar;
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: globalVarClosure in /in/ZZUvB on line 23 Here is the argument BEFORE we modify it:Here it is AFTER:Now I've been modified by the function.
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: globalVarClosure in /in/ZZUvB on line 23 Here is the argument BEFORE we modify it:Here it is AFTER:Now I've been modified by the function.