3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = microtime(true); $a = [ 'hallo welt', ' asss ', 'adasd13e1 123w1 23w123w21', '1232', '1231245rt235491340921830', '41904e09218i3219ß21093ß02193ß0219ß0', '2135r423', '!2242321', '21421421', '44', '1', '12435r2390ß4038i12ß2190ßi2ß10', ]; $a = array_filter($a, function($value) { return strlen($value) <= 10; }); $b = 5; $s = 10; $a = array_slice($a, 0, $b); $a = array_combine( range($s, $b*$s , $s), $a); var_dump( $a, microtime(true)-$start ); $start = microtime(true); $a = [ 'hatlo welt', ' asss ', 'adasd13e1 123w1 23w123w21', '1232', '1231245rt235491340921830', '41904e09218i3219ß21093ß02193ß0219ß0', '2135r423', '!2242321', '21421421', '44', '1', '12435r2390ß4038i12ß2190ßi2ß10', ]; $i = 0; $result =[]; foreach ($a as $bullet_point) { if (strlen($bullet_point) > 10 ) { continue; } $i+=1; $sort = $i * $s; $result[$sort] = $bullet_point; if ($i == $b) { break; } } if ($i < 0) { return false; } var_dump($result, microtime(true)-$start );

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.4.00.0100.01014.99
7.3.120.0120.00614.80
7.3.110.0070.00715.02
7.3.100.0060.00915.08
7.3.90.0060.00814.70
7.3.80.0030.00614.88
7.3.70.0040.00714.50
7.3.60.0000.01514.91
7.3.50.0070.01014.92
7.3.40.0030.01014.96
7.3.30.0070.01014.61
7.3.20.0000.01416.52
7.3.10.0020.01116.69
7.3.00.0070.00616.75
7.2.250.0040.01115.24
7.2.240.0100.01015.00
7.2.230.0110.00415.02
7.2.220.0000.01415.19
7.2.210.0100.00314.66
7.2.200.0080.00815.16
7.2.190.0000.01514.84
7.2.180.0040.01115.17
7.2.170.0030.01015.21
7.2.130.0090.00316.74
7.2.120.0070.01117.03
7.2.110.0070.00716.94
7.2.100.0070.01016.76
7.2.90.0100.00717.04
7.2.80.0030.00716.95
7.2.70.0030.01017.09
7.2.60.0090.00617.04
7.2.50.0040.01416.98
7.2.40.0040.01116.81
7.2.30.0060.00917.12
7.2.20.0030.01016.88
7.2.10.0060.00917.05
7.2.00.0020.01118.14
7.1.330.0070.01015.92
7.1.320.0070.00716.05
7.1.310.0030.01215.72
7.1.300.0030.01015.75
7.1.290.0030.01015.89
7.1.280.0060.00615.66
7.1.270.0120.00315.97
7.1.260.0030.00616.06
7.1.250.0100.00315.78
7.1.100.0060.00917.98
7.1.70.0150.00017.09
7.1.60.2470.01733.23
7.1.50.2200.02032.70
7.1.40.2930.02032.85
7.1.30.2830.01732.61
7.1.20.0300.02032.79
7.1.10.1330.02014.92
7.1.00.1600.01014.89
7.0.200.1700.01714.96
7.0.190.2600.01014.98
7.0.180.2770.01314.50
7.0.170.0270.01314.61
7.0.160.3030.01314.32
7.0.150.1400.00314.56
7.0.140.1300.01314.78
7.0.130.0200.01314.62
7.0.120.0070.01314.82
7.0.110.1400.00714.48
7.0.100.2130.01714.24
7.0.90.0000.02014.30
7.0.80.0270.01014.52
7.0.70.0130.00714.66
7.0.60.0830.01314.14
7.0.50.0100.01714.50
7.0.40.1400.01314.65
7.0.30.1130.02014.41
7.0.20.2070.01014.64
7.0.10.0030.01314.66
7.0.00.0400.01314.65

preferences:
33.08 ms | 401 KiB | 5 Q