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', 'Two is less than one');
Output for 5.4.8 - 5.6.28, 7.0.0 - 7.1.0
Warning: phpinfo() has been disabled for security reasons in /in/JnmK6 on line 20 Warning: assert(): Assertion "2 < 1" failed in /in/JnmK6 on line 20 Warning: phpinfo() has been disabled for security reasons in /in/JnmK6 on line 21 Warning: assert(): Two is less than one: "2 < 1" failed in /in/JnmK6 on line 21
Output for hhvm-3.12.0
Fatal error: Uncaught TypeError: Argument 1 passed to phpinfo() must be an instance of int, string given in /in/JnmK6:20 Stack trace: #0 /in/JnmK6(20): phpinfo() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Catchable fatal error: Argument 1 passed to phpinfo() must be an instance of int, string given in /in/JnmK6 on line 20
Process exited with code 255.
Output for 5.3.0 - 5.4.7
Warning: phpinfo() has been disabled for security reasons in /in/JnmK6 on line 20 Warning: assert(): Assertion "2 < 1" failed in /in/JnmK6 on line 20 Warning: assert() expects exactly 1 parameter, 2 given in /in/JnmK6 on line 21
Output for 4.3.5 - 5.2.17
Warning: phpinfo() has been disabled for security reasons in /in/JnmK6 on line 20 Warning: assert(): Assertion "2 < 1" failed in /in/JnmK6 on line 20 Warning: Wrong parameter count for assert() in /in/JnmK6 on line 21
Output for 4.3.2 - 4.3.4
Warning: phpinfo,mail() has been disabled for security reasons in /in/JnmK6 on line 20 Warning: assert(): Assertion "2 < 1" failed in /in/JnmK6 on line 20 Warning: Wrong parameter count for assert() in /in/JnmK6 on line 21
Output for 4.3.0 - 4.3.1
Warning: phpinfo,mail() has been disabled for security reasons in /in/JnmK6 on line 20 Warning: assert() [http://www.php.net/function.assert]: Assertion "2 < 1" failed in /in/JnmK6 on line 20 Warning: Wrong parameter count for assert() in /in/JnmK6 on line 21