3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Active assert and make it quiet assert_options(ASSERT_ACTIVE, 1); assert_options(ASSERT_WARNING, 0); assert_options(ASSERT_QUIET_EVAL, 1); // Create a handler function function my_assert_handler($file, $line, $code) { echo "<hr>Assertion Failed: File '$file'<br /> Line '$line'<br /> Code '$code'<br /><hr />"; } // Set up the callback assert_options(ASSERT_CALLBACK, 'my_assert_handler'); // Make an assertion that should fail assert('mysql_query("")');
Output for 7.2.0
Deprecated: assert(): Calling assert() with a string argument is deprecated in /in/GJ8Hj on line 21 Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/GJ8Hj(21) : assert code:1 Stack trace: #0 [internal function]: unknown() #1 /in/GJ8Hj(21): assert('mysql_query("")') #2 {main} thrown in /in/GJ8Hj(21) : assert code on line 1
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/GJ8Hj(21) : assert code:1 Stack trace: #0 [internal function]: unknown() #1 /in/GJ8Hj(21): assert('mysql_query("")') #2 {main} thrown in /in/GJ8Hj(21) : assert code on line 1
Process exited with code 255.
Output for 5.3.18 - 5.6.28

Process exited with code 255.