3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('display_errors', 1); error_reporting(E_ALL); echo '#+++++++++++++++++++++++++++++++++++#' . PHP_EOL; echo '# Checking if a constant is defined #' . PHP_EOL; echo '# always retuns (bool)false in PHP. #' . PHP_EOL; echo '# Even if it has been defined! #' . PHP_EOL; echo '#+++++++++++++++++++++++++++++++++++#' . PHP_EOL; echo 'Testing on PHP version ' PHP_VERSION . PHP_EOL . PHP_EOL; echo 'Result of `echo __FILE__`: ' . PHP_EOL; echo __FILE__; echo PHP_EOL . PHP_EOL; echo 'Okay, looks like __FILE__ is defined.' . PHP_EOL; echo 'Now let\'s see what `if ( defined('__FILE__') )` returns:' . PHP_EOL; var_dump(defined('__FILE__'));
Output for 5.4.0 - 5.4.19
Parse error: syntax error, unexpected 'PHP_VERSION' (T_STRING), expecting ',' or ';' in /in/5lptA on line 11
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /in/5lptA on line 11
Process exited with code 255.

preferences:
181.87 ms | 1395 KiB | 55 Q