3v4l.org

run code in 300+ PHP versions simultaneously
<?php $all = []; for( $i=0; $i<2000; $i++ ) { for( $j=0; $j<500; $j++ ) { $all[$i][$j] = $j; } } $mergedArray = []; $start = microtime(true); foreach($all as &$templateClosingArray) { $mergedArray += $templateClosingArray; } $mergedArray = []; foreach($all as &$templateClosingArray) { $mergedArray += $templateClosingArray; } $mergedArray = []; foreach($all as &$templateClosingArray) { $mergedArray += $templateClosingArray; } echo PHP_EOL . 'Union time: ' . microtime(true); $start = microtime(true); $mergedArray = []; $mergedArray = array_merge(...$all); $mergedArray = []; $mergedArray = array_merge(...$all); $mergedArray = []; $mergedArray = array_merge(...$all); echo PHP_EOL . 'Array merge time: ' . microtime(true);
Output for 8.4.14
Union time: 1761814808.0968 Array merge time: 1761814808.1245
Output for 8.4.13
Union time: 1761814808.0476 Array merge time: 1761814808.0752
Output for 8.4.12
Union time: 1761814808.0826 Array merge time: 1761814808.1108
Output for 8.4.11
Union time: 1761814808.0945 Array merge time: 1761814808.1228
Output for 8.4.10
Union time: 1761814808.0992 Array merge time: 1761814808.1398
Output for 8.4.9
Union time: 1761814808.1065 Array merge time: 1761814808.1417
Output for 8.4.8
Union time: 1761814808.0994 Array merge time: 1761814808.127
Output for 8.4.7
Union time: 1761814808.1103 Array merge time: 1761814808.1798
Output for 8.4.6
Union time: 1761814808.0978 Array merge time: 1761814808.1253
Output for 8.4.5
Union time: 1761814808.0956 Array merge time: 1761814808.1245
Output for 8.4.4
Union time: 1761814808.0877 Array merge time: 1761814808.117
Output for 8.4.3
Union time: 1761814808.0906 Array merge time: 1761814808.1182
Output for 8.4.2
Union time: 1761814808.0972 Array merge time: 1761814808.1283
Output for 8.4.1
Union time: 1761814808.0868 Array merge time: 1761814808.1161
Output for 8.3.27
Union time: 1761814808.0836 Array merge time: 1761814808.1277
Output for 8.3.26
Union time: 1761814808.0781 Array merge time: 1761814808.1056
Output for 8.3.25
Union time: 1761814808.0446 Array merge time: 1761814808.0719
Output for 8.3.24
Union time: 1761814808.0621 Array merge time: 1761814808.1111
Output for 8.3.23
Union time: 1761814808.0827 Array merge time: 1761814808.1106
Output for 8.3.22
Union time: 1761814808.0912 Array merge time: 1761814808.1203
Output for 8.3.21
Union time: 1761814808.0816 Array merge time: 1761814808.1142
Output for 8.3.20
Union time: 1761814808.0915 Array merge time: 1761814808.1207
Output for 8.3.19
Union time: 1761814808.089 Array merge time: 1761814808.1174
Output for 8.3.18
Union time: 1761814808.106 Array merge time: 1761814808.1394
Output for 8.3.17
Union time: 1761814808.0449 Array merge time: 1761814808.0722
Output for 8.3.16
Union time: 1761814808.096 Array merge time: 1761814808.1586
Output for 8.3.15
Union time: 1761814808.0979 Array merge time: 1761814808.126
Output for 8.3.14
Union time: 1761814808.0876 Array merge time: 1761814808.1158
Output for 8.3.13
Union time: 1761814808.0896 Array merge time: 1761814808.1176
Output for 8.3.12
Union time: 1761814808.0487 Array merge time: 1761814808.0781
Output for 8.3.11
Union time: 1761814808.0937 Array merge time: 1761814808.1495
Output for 8.3.10
Union time: 1761814808.0458 Array merge time: 1761814808.074
Output for 8.3.9
Union time: 1761814808.0898 Array merge time: 1761814808.1206
Output for 8.3.8
Union time: 1761814808.0958 Array merge time: 1761814808.1452
Output for 8.3.7
Union time: 1761814808.1043 Array merge time: 1761814808.1649
Output for 8.3.6
Union time: 1761814808.0885 Array merge time: 1761814808.1161
Output for 8.3.5
Union time: 1761814808.0902 Array merge time: 1761814808.1189
Output for 8.3.4
Union time: 1761814808.0977 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.3.3
Union time: 1761814808.0903 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.3.2
Union time: 1761814808.0946 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.3.1
Union time: 1761814808.0439 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.3.0
Union time: 1761814808.0924 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.29
Union time: 1761814808.0636 Array merge time: 1761814808.0939
Output for 8.2.28
Union time: 1761814808.0859 Array merge time: 1761814808.1188
Output for 8.2.27
Union time: 1761814808.0853 Array merge time: 1761814808.1438
Output for 8.2.26
Union time: 1761814808.0875 Array merge time: 1761814808.121
Output for 8.2.25
Union time: 1761814808.0829 Array merge time: 1761814808.1333
Output for 8.2.24
Union time: 1761814808.0425 Array merge time: 1761814808.0708
Output for 8.2.23
Union time: 1761814808.0417 Array merge time: 1761814808.0706
Output for 8.2.22
Union time: 1761814808.0453 Array merge time: 1761814808.073
Output for 8.2.21
Union time: 1761814808.0513 Array merge time: 1761814808.0817
Output for 8.2.20
Union time: 1761814808.0708 Array merge time: 1761814808.1003
Output for 8.2.19
Union time: 1761814808.0845 Array merge time: 1761814808.1164
Output for 8.2.18
Union time: 1761814808.0876 Array merge time: 1761814808.1497
Output for 8.2.17
Union time: 1761814808.0755 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.16
Union time: 1761814808.0959 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.15
Union time: 1761814808.0991 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.14
Union time: 1761814808.1092 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.13
Union time: 1761814808.0926 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.12
Union time: 1761814808.095 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.11
Union time: 1761814808.0979 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.10
Union time: 1761814808.0484 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.9
Union time: 1761814808.104 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.8
Union time: 1761814808.0999 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.7
Union time: 1761814808.1066 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.6
Union time: 1761814808.0927 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.5
Union time: 1761814808.0876 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.4
Union time: 1761814808.0983 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.3
Union time: 1761814808.1019 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.2
Union time: 1761814808.0995 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.1
Union time: 1761814808.0949 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.0
Union time: 1761814808.1086 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/n9P5j on line 27 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.

preferences:
44.7 ms | 515 KiB | 5 Q