3v4l.org

run code in 300+ PHP versions simultaneously
<?php function depth_picker($arr, $temp_string, &$collect) { if ($temp_string != "") $collect []= $temp_string; for ($i=0; $i<sizeof($arr);$i++) { $arrcopy = $arr; $elem = array_splice($arrcopy, $i, 1); // removes and returns the i'th element if (sizeof($arrcopy) > 0) { depth_picker($arrcopy, $temp_string ." " . $elem[0], $collect); } else { $collect []= $temp_string. " " . $elem[0]; } } } $collect = array(); depth_picker(array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'), "", $collect); print_r($collect);
Output for 8.2.18, 8.3.6
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 16777224 bytes) in /in/iUCk4 on line 13
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: Allowed memory size of 67108864 bytes exhausted (tried to allocate 16777224 bytes) in /in/iUCk4 on line 13
Process exited with code 255.
Output for 8.2.10 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Out of memory (allocated 27267072 bytes) (tried to allocate 8388616 bytes) in /in/iUCk4 on line 5 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.28, 7.3.0 - 7.3.15, 7.4.0 - 7.4.3, 8.1.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 33554440 bytes) in /in/iUCk4 on line 13
Process exited with code 255.
Output for 8.1.23 - 8.1.27
Fatal error: Out of memory (allocated 31461376) (tried to allocate 16777224 bytes) in /in/iUCk4 on line 5 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/iUCk4 on line 7
Process exited with code 255.
Output for 5.5.0 - 5.5.38
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/iUCk4 on line 9
Process exited with code 255.
Output for 5.2.6, 5.4.0 - 5.4.45
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /in/iUCk4 on line 9
Process exited with code 255.
Output for 5.2.2, 5.2.7 - 5.2.17, 5.3.0 - 5.3.29
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 51 bytes) in /in/iUCk4 on line 11
Process exited with code 255.
Output for 5.2.3 - 5.2.5
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in /in/iUCk4 on line 9
Process exited with code 255.
Output for 5.2.1
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 53 bytes) in /in/iUCk4 on line 13
Process exited with code 255.
Output for 4.4.5 - 4.4.9, 5.1.5 - 5.1.6, 5.2.0

Process exited with code 137.

preferences:
206.49 ms | 401 KiB | 325 Q