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, 5.5.0 - 5.5.3
Parse error: syntax error, unexpected '__FILE__' (T_FILE), expecting ',' or ';' in /in/Kkr8M on line 19
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_FILE, expecting ',' or ';' in /in/Kkr8M on line 19
Process exited with code 255.

preferences:
183.77 ms | 1395 KiB | 59 Q