3v4l.org

run code in 300+ PHP versions simultaneously
<?php assert_options(ASSERT_CALLBACK, "assert_handler"); function assert_handler($file, $line, $assertion, $description="") { echo "* assert_handler('$file', '$line', '$assertion', '$description') called"; return true; } assert('false == true'); assert(false == true); assert(false == true, "Expected assert() to fail for this test and emit the actual test as 3rd parameter to handler");
Output for 8.0.0beta1
* assert_handler('/in/1G2Zo', '11', '', 'assert(false == true)') called Fatal error: Uncaught AssertionError: assert(false == true) in /in/1G2Zo:11 Stack trace: #0 /in/1G2Zo(11): assert(false, 'assert(false ==...') #1 {main} thrown in /in/1G2Zo on line 11
Process exited with code 255.
Output for 8.0.0alpha1 - alpha3
* assert_handler('/in/1G2Zo', '11', '', 'assert(false == true)') called Warning: assert(): assert(false == true) failed in /in/1G2Zo on line 11 * assert_handler('/in/1G2Zo', '12', '', 'Expected assert() to fail for this test and emit the actual test as 3rd parameter to handler') called Warning: assert(): Expected assert() to fail for this test and emit the actual test as 3rd parameter to handler failed in /in/1G2Zo on line 12
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.21, 7.4.0 - 7.4.9
Deprecated: assert(): Calling assert() with a string argument is deprecated in /in/1G2Zo on line 10 * assert_handler('/in/1G2Zo', '10', 'false == true', '') called Warning: assert(): Assertion "false == true" failed in /in/1G2Zo on line 10 * assert_handler('/in/1G2Zo', '11', '', 'assert(false == true)') called Warning: assert(): assert(false == true) failed in /in/1G2Zo on line 11 * assert_handler('/in/1G2Zo', '12', '', 'Expected assert() to fail for this test and emit the actual test as 3rd parameter to handler') called Warning: assert(): Expected assert() to fail for this test and emit the actual test as 3rd parameter to handler failed in /in/1G2Zo on line 12
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
* assert_handler('/in/1G2Zo', '10', 'false == true', '') called Warning: assert(): Assertion "false == true" failed in /in/1G2Zo on line 10 * assert_handler('/in/1G2Zo', '11', '', 'assert(false == true)') called Warning: assert(): assert(false == true) failed in /in/1G2Zo on line 11 * assert_handler('/in/1G2Zo', '12', '', 'Expected assert() to fail for this test and emit the actual test as 3rd parameter to handler') called Warning: assert(): Expected assert() to fail for this test and emit the actual test as 3rd parameter to handler failed in /in/1G2Zo on line 12
Output for 5.4.8 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
* assert_handler('/in/1G2Zo', '10', 'false == true', '') called Warning: assert(): Assertion "false == true" failed in /in/1G2Zo on line 10 * assert_handler('/in/1G2Zo', '11', '', '') called Warning: assert(): Assertion failed in /in/1G2Zo on line 11 * assert_handler('/in/1G2Zo', '12', '', 'Expected assert() to fail for this test and emit the actual test as 3rd parameter to handler') called Warning: assert(): Expected assert() to fail for this test and emit the actual test as 3rd parameter to handler failed in /in/1G2Zo on line 12
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.7
* assert_handler('/in/1G2Zo', '10', 'false == true', '') called Warning: assert(): Assertion "false == true" failed in /in/1G2Zo on line 10 * assert_handler('/in/1G2Zo', '11', '', '') called Warning: assert(): Assertion failed in /in/1G2Zo on line 11 Warning: assert() expects exactly 1 parameter, 2 given in /in/1G2Zo on line 12
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
* assert_handler('/in/1G2Zo', '10', 'false == true', '') called Warning: assert(): Assertion "false == true" failed in /in/1G2Zo on line 10 * assert_handler('/in/1G2Zo', '11', '', '') called Warning: assert(): Assertion failed in /in/1G2Zo on line 11 Warning: Wrong parameter count for assert() in /in/1G2Zo on line 12
Output for 4.3.0 - 4.3.1
* assert_handler('/in/1G2Zo', '10', 'false == true', '') called Warning: assert() [http://www.php.net/function.assert]: Assertion "false == true" failed in /in/1G2Zo on line 10 * assert_handler('/in/1G2Zo', '11', '', '') called Warning: assert() [http://www.php.net/function.assert]: Assertion failed in /in/1G2Zo on line 11 Warning: Wrong parameter count for assert() in /in/1G2Zo on line 12