3v4l.org

run code in 300+ PHP versions simultaneously
<?php function contextCheck($context) { return isset($_GET[$context] ? $_GET[$context] : false; } $_GET['foo'] = '12'; $_GET['bar'] = '0'; echo 'foo: ', var_export(contextCheck( 'foo' ), true ), "\n", 'bar: ', var_export( contextCheck( 'bar' ), true ); ?>
Output for 5.5.0 - 5.5.8
Parse error: syntax error, unexpected ';' in /in/anSn9 on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.24
Parse error: syntax error, unexpected '?', expecting ',' or ')' in /in/anSn9 on line 4
Process exited with code 255.

preferences:
185.52 ms | 1395 KiB | 70 Q