3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getStaticVar($name, $t = false) { static $flags = array(); if(!isset($flags[$name])) { $flags[$name] = false; } if ($t) { $flags[$name] = true; } return $flags[$name]; } $name = 'varName'; echo function getStaticVar($name); echo function getStaticVar($name); echo function getStaticVar($name);
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected 'getStaticVar' (T_STRING), expecting '(' in /in/l86e8 on line 21
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting '(' in /in/l86e8 on line 21
Process exited with code 255.

preferences:
171.01 ms | 1399 KiB | 62 Q