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; } $end = microtime(true); echo PHP_EOL . 'Union time: ' . $end; $start = microtime(true); $mergedArray = []; $mergedArray = array_merge(...$all); $mergedArray = []; $mergedArray = array_merge(...$all); $mergedArray = []; $mergedArray = array_merge(...$all); $end = microtime(true); echo PHP_EOL . 'Array merge time: ' . $end;
Output for 8.4.14
Union time: 1761814899.102 Array merge time: 1761814899.1359
Output for 8.4.13
Union time: 1761814899.0953 Array merge time: 1761814899.1542
Output for 8.4.12
Union time: 1761814899.0535 Array merge time: 1761814899.083
Output for 8.4.11
Union time: 1761814899.0625 Array merge time: 1761814899.0917
Output for 8.4.10
Union time: 1761814899.0975 Array merge time: 1761814899.1579
Output for 8.4.9
Union time: 1761814899.0942 Array merge time: 1761814899.1221
Output for 8.4.8
Union time: 1761814899.0972 Array merge time: 1761814899.127
Output for 8.4.7
Union time: 1761814899.0967 Array merge time: 1761814899.1257
Output for 8.4.6
Union time: 1761814899.0933 Array merge time: 1761814899.1262
Output for 8.4.5
Union time: 1761814899.0969 Array merge time: 1761814899.1279
Output for 8.4.4
Union time: 1761814899.1003 Array merge time: 1761814899.1336
Output for 8.4.3
Union time: 1761814899.1003 Array merge time: 1761814899.1293
Output for 8.4.2
Union time: 1761814899.102 Array merge time: 1761814899.1333
Output for 8.4.1
Union time: 1761814899.0979 Array merge time: 1761814899.1268
Output for 8.3.27
Union time: 1761814899.0935 Array merge time: 1761814899.1239
Output for 8.3.26
Union time: 1761814899.0466 Array merge time: 1761814899.0745
Output for 8.3.25
Union time: 1761814899.0822 Array merge time: 1761814899.114
Output for 8.3.24
Union time: 1761814899.0917 Array merge time: 1761814899.1198
Output for 8.3.23
Union time: 1761814899.08 Array merge time: 1761814899.1078
Output for 8.3.22
Union time: 1761814899.0864 Array merge time: 1761814899.1189
Output for 8.3.21
Union time: 1761814899.0955 Array merge time: 1761814899.1502
Output for 8.3.20
Union time: 1761814899.0475 Array merge time: 1761814899.092
Output for 8.3.19
Union time: 1761814899.0903 Array merge time: 1761814899.1189
Output for 8.3.18
Union time: 1761814899.0781 Array merge time: 1761814899.107
Output for 8.3.17
Union time: 1761814899.0944 Array merge time: 1761814899.1586
Output for 8.3.16
Union time: 1761814899.0897 Array merge time: 1761814899.1181
Output for 8.3.15
Union time: 1761814899.0492 Array merge time: 1761814899.0772
Output for 8.3.14
Union time: 1761814899.046 Array merge time: 1761814899.0766
Output for 8.3.13
Union time: 1761814899.0916 Array merge time: 1761814899.1236
Output for 8.3.12
Union time: 1761814899.0437 Array merge time: 1761814899.0744
Output for 8.3.11
Union time: 1761814899.0892 Array merge time: 1761814899.1197
Output for 8.3.10
Union time: 1761814899.0914 Array merge time: 1761814899.1227
Output for 8.3.9
Union time: 1761814899.091 Array merge time: 1761814899.1213
Output for 8.3.8
Union time: 1761814899.1034 Array merge time: 1761814899.145
Output for 8.3.7
Union time: 1761814899.1041 Array merge time: 1761814899.133
Output for 8.3.6
Union time: 1761814899.0913 Array merge time: 1761814899.1347
Output for 8.3.5
Union time: 1761814899.1041 Array merge time: 1761814899.1481
Output for 8.3.4
Union time: 1761814899.1016 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.3.3
Union time: 1761814899.0463 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.3.2
Union time: 1761814899.0918 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.3.1
Union time: 1761814899.0865 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.3.0
Union time: 1761814899.099 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.29
Union time: 1761814899.088 Array merge time: 1761814899.116
Output for 8.2.28
Union time: 1761814899.0887 Array merge time: 1761814899.1172
Output for 8.2.27
Union time: 1761814899.0733 Array merge time: 1761814899.1031
Output for 8.2.26
Union time: 1761814899.0865 Array merge time: 1761814899.119
Output for 8.2.25
Union time: 1761814899.0859 Array merge time: 1761814899.1164
Output for 8.2.24
Union time: 1761814899.0901 Array merge time: 1761814899.1203
Output for 8.2.23
Union time: 1761814899.0816 Array merge time: 1761814899.1135
Output for 8.2.22
Union time: 1761814899.0864 Array merge time: 1761814899.1207
Output for 8.2.21
Union time: 1761814899.0804 Array merge time: 1761814899.1126
Output for 8.2.20
Union time: 1761814899.0848 Array merge time: 1761814899.1197
Output for 8.2.19
Union time: 1761814899.0832 Array merge time: 1761814899.1114
Output for 8.2.18
Union time: 1761814899.0834 Array merge time: 1761814899.1178
Output for 8.2.17
Union time: 1761814899.0917 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.16
Union time: 1761814899.0969 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.15
Union time: 1761814899.0943 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.14
Union time: 1761814899.095 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.13
Union time: 1761814899.0892 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.12
Union time: 1761814899.0932 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.11
Union time: 1761814899.102 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.10
Union time: 1761814899.0964 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.9
Union time: 1761814899.1052 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.8
Union time: 1761814899.1042 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.7
Union time: 1761814899.0945 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.6
Union time: 1761814899.0484 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.5
Union time: 1761814899.1166 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.4
Union time: 1761814899.0958 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.3
Union time: 1761814899.0898 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.2
Union time: 1761814899.0954 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.1
Union time: 1761814899.1038 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.2.0
Union time: 1761814899.1032 Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 16777224 bytes) in /in/6NNSP on line 28 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.

preferences:
79.5 ms | 515 KiB | 5 Q