3v4l.org

run code in 300+ PHP versions simultaneously
<?php assert_options(ASSERT_ACTIVE, 1); assert_options(ASSERT_WARNING, 0); assert_options(ASSERT_QUIET_EVAL, 1); try { assert(PHP_MAJOR_VERSION >= 7, new Exception('PHP 7 is requiered!')); } catch (Exception $e) { quit(); } echo 'Hi!';
Output for 8.3.0 - 8.3.6
Deprecated: Constant ASSERT_ACTIVE is deprecated in /in/Wk7HC on line 2 Deprecated: Function assert_options() is deprecated in /in/Wk7HC on line 2 Deprecated: Constant ASSERT_WARNING is deprecated in /in/Wk7HC on line 3 Deprecated: Function assert_options() is deprecated in /in/Wk7HC on line 3 Fatal error: Uncaught Error: Undefined constant "ASSERT_QUIET_EVAL" in /in/Wk7HC:4 Stack trace: #0 {main} thrown in /in/Wk7HC on line 4
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Fatal error: Uncaught Error: Undefined constant "ASSERT_QUIET_EVAL" in /in/Wk7HC:4 Stack trace: #0 {main} thrown in /in/Wk7HC on line 4
Process exited with code 255.
Output for 5.4.8 - 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.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Hi!
Output for 5.4.2 - 5.4.7
Warning: assert() expects exactly 1 parameter, 2 given in /in/Wk7HC on line 6 Hi!

preferences:
218.34 ms | 401 KiB | 268 Q