3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { assert(PHP_MAJOR_VERSION >= 7, new Exception('PHP 7 is requiered!')); } catch (Exception $e) { quit(); } echo 'Hi!';
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Hi!
Output for 5.4.8 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Warning: assert(): exception 'Exception' with message 'PHP 7 is requiered!' in /in/nPqkR:2 Stack trace: #0 {main} failed in /in/nPqkR on line 2 Hi!
Output for 5.4.2 - 5.4.7
Warning: assert() expects exactly 1 parameter, 2 given in /in/nPqkR on line 2 Hi!

preferences:
160.24 ms | 401 KiB | 222 Q