3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php assert_options(ASSERT_ACTIVE, 1); assert_options(ASSERT_WARNING, 1); assert_options(ASSERT_QUIET_EVAL, 1); try { assert(PHP_MAJOR_VERSION >= 7, new Exception('PHP 7 is requiered!')); } catch (Exception $e) { quit(); } echo 'Hi!';
based on Wk7HC
Output for 7.0.0 - 7.2.0
Hi!
Output for 5.4.8 - 5.6.28
Warning: assert(): exception 'Exception' with message 'PHP 7 is requiered!' in /in/BKvLG:6 Stack trace: #0 {main} failed in /in/BKvLG on line 6 Hi!
Output for 5.3.18 - 5.4.7
Warning: assert() expects exactly 1 parameter, 2 given in /in/BKvLG on line 6 Hi!