3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Active assert and make it quiet assert_options(ASSERT_ACTIVE, 1); // Create a handler function function my_assert_handler($file, $line, $code, $desc = null) { echo "Assertion failed at $file:$line: $code"; if ($desc) { echo ": $desc"; } echo "\n"; } // Set up the callback assert_options(ASSERT_CALLBACK, 'phpinfo'); // Make an assertion that should fail assert('2 < 1'); assert('2 < 1', '<img src=1>');
Output for 5.4.36 - 7.1.0
Warning: phpinfo() has been disabled for security reasons in /in/n84k7 on line 20 Warning: assert(): Assertion "2 < 1" failed in /in/n84k7 on line 20 Warning: phpinfo() has been disabled for security reasons in /in/n84k7 on line 21 Warning: assert(): <img src=1>: "2 < 1" failed in /in/n84k7 on line 21
Output for 5.4.8 - 5.4.35
Warning: phpinfo() expects at most 1 parameter, 3 given in /in/n84k7 on line 20 Warning: assert(): Assertion "2 < 1" failed in /in/n84k7 on line 20 Warning: phpinfo() expects at most 1 parameter, 4 given in /in/n84k7 on line 21 Warning: assert(): <img src=1>: "2 < 1" failed in /in/n84k7 on line 21
Output for 5.3.0 - 5.4.7
Warning: phpinfo() expects at most 1 parameter, 3 given in /in/n84k7 on line 20 Warning: assert(): Assertion "2 < 1" failed in /in/n84k7 on line 20 Warning: assert() expects exactly 1 parameter, 2 given in /in/n84k7 on line 21
Output for 4.3.2 - 5.2.17
Warning: phpinfo() expects at most 1 parameter, 3 given in /in/n84k7 on line 20 Warning: assert(): Assertion "2 < 1" failed in /in/n84k7 on line 20 Warning: Wrong parameter count for assert() in /in/n84k7 on line 21
Output for 4.3.1
Warning: phpinfo() expects at most 1 parameter, 3 given in /in/n84k7 on line 20 Warning: assert() [http://www.php.net/function.assert]: Assertion "2 < 1" failed in /in/n84k7 on line 20 Warning: Wrong parameter count for assert() in /in/n84k7 on line 21
Output for 4.3.0
Warning: phpinfo,mail() has been disabled for security reasons in /in/n84k7 on line 20 Warning: assert() [http://www.php.net/function.assert]: Assertion "2 < 1" failed in /in/n84k7 on line 20 Warning: Wrong parameter count for assert() in /in/n84k7 on line 21