3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('DEFINED_LOWER', '1.3.0.0'); define('DEFINED_HIGHER', '1.6.0.0'); $version = 1.4; var_dump ( version_compare(DEFINED_HIGHER, $version, '<')); var_dump ( version_compare(NOT_DEFINED, $version, '<')); var_dump ( version_compare(DEFINED_LOWER, $version, '<')); var_dump ( version_compare(NOT_DEFINED, $version, '<'));
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
bool(false) Fatal error: Uncaught Error: Undefined constant "NOT_DEFINED" in /in/JSZq7:8 Stack trace: #0 {main} thrown in /in/JSZq7 on line 8
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
bool(false) Warning: Use of undefined constant NOT_DEFINED - assumed 'NOT_DEFINED' (this will throw an Error in a future version of PHP) in /in/JSZq7 on line 8 bool(true) bool(true) Warning: Use of undefined constant NOT_DEFINED - assumed 'NOT_DEFINED' (this will throw an Error in a future version of PHP) in /in/JSZq7 on line 11 bool(true)
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20
bool(false) Notice: Use of undefined constant NOT_DEFINED - assumed 'NOT_DEFINED' in /in/JSZq7 on line 8 bool(true) bool(true) Notice: Use of undefined constant NOT_DEFINED - assumed 'NOT_DEFINED' in /in/JSZq7 on line 11 bool(true)

preferences:
158.92 ms | 403 KiB | 225 Q