3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Arrange $object = new SplFixedArray(2); $object[0] = 'first-value'; $object[1] = 'second-value'; // Act foreach ($object as $key1 => $val1) { foreach ($object as $key2 => $val2) { break; } } // Assert // Will never execute... assert(TRUE === FALSE); // Zjistěte proč v článku na pehapkari.cz: https://github.com/pehapkari/pehapkari.cz/pull/285 // Step into explanation at GitHub: https://github.com/pehapkari/pehapkari.cz/pull/285/files#diff-7677a91736a5051440021053d8fa6962R9
Output for 8.1.23 - 8.1.28, 8.2.10 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught AssertionError: assert(TRUE === FALSE) in /in/LDQ6i:17 Stack trace: #0 /in/LDQ6i(17): assert(false, 'assert(TRUE ===...') #1 {main} thrown in /in/LDQ6i on line 17
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 Fatal error: Uncaught AssertionError: assert(TRUE === FALSE) in /in/LDQ6i:17 Stack trace: #0 /in/LDQ6i(17): assert(false, 'assert(TRUE ===...') #1 {main} thrown in /in/LDQ6i on line 17
Process exited with code 255.
Output for 7.0.24 - 7.0.30, 7.1.10 - 7.1.28, 7.2.4 - 7.2.29, 7.3.4 - 7.3.16, 7.4.3 - 7.4.4

Process exited with code 137.

preferences:
77.64 ms | 402 KiB | 47 Q