3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function retour1($parametre="OK") { return $parametre; } function retour2($parametre=NULL) { if (!$parametre) { $parametre="OK"; } return $parametre; } $GLOBALS['parametre'] = "OK"; function retour3($parametre=$GLOBALS['parametre']) { return $parametre; } echo retour1(); echo retour1("OK"); echo retour2(); echo retour2("OK"); echo retour3();
Output for hhvm-3.10.0 - 3.12.0
OKOKOKOKOK
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected '$GLOBALS' (T_VARIABLE) in /in/bHi2P on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/bHi2P on line 8
Process exited with code 255.