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.3.0 - 8.3.4, 8.3.6
Deprecated: Constant ASSERT_CALLBACK is deprecated in /in/1G2Zo on line 2 Deprecated: Function assert_options() is deprecated in /in/1G2Zo on line 2 * 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.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Deprecated: Constant ASSERT_CALLBACK is deprecated in /in/1G2Zo on line 2 Deprecated: Function assert_options() is deprecated in /in/1G2Zo on line 2 * 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.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
* 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 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.3.33, 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
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, 7.3.32, 7.4.26
* 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

preferences:
323.44 ms | 402 KiB | 458 Q