3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(0); $amount = 100000; $start = microtime(true); for($i = 0; $i < $amount ; $i++) { $alreadyOutput = array(); foreach ($results as $result) { if(in_array($result->date, $alreadyOutput)){ continue; } $alreadyOutput[] = $result->date; echo $result->date . "<br />"; } } echo "in_array: ".(microtime(true) - $start)."ms || "; $start2 = microtime(true); for($i = 0; $i < $amount ; $i++) { $echoedArray = array(); foreach ($results as $result) { if ($echoedArray[$result->date]) { continue; } echo $result->date . "<br />"; $echoedArray[$result->date] = true; } } echo "by key: ".(microtime(true) - $start2)."ms";

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.2.00.0030.08519.56
7.1.70.0030.08416.93
7.1.60.0100.12219.46
7.1.50.0130.10716.83
7.1.00.0130.19722.43
7.0.200.0070.07714.82
7.0.140.0000.19022.07
7.0.60.0030.18019.88
7.0.50.0030.15717.91
7.0.40.0130.16719.98
7.0.30.0370.15320.20
7.0.20.0370.14020.09
7.0.10.0130.11320.16
7.0.00.0170.15320.09
5.6.280.0000.20021.13
5.6.210.0100.15320.65
5.6.200.0070.17718.13
5.6.190.0070.19320.49
5.6.180.0200.13720.35
5.6.170.0300.15320.48
5.6.160.0100.13720.41
5.6.150.0030.16318.18
5.6.140.0000.17318.11
5.6.130.0030.12018.14
5.6.120.0070.16020.86
5.6.110.0030.12721.02
5.6.100.0030.11321.04
5.6.90.0170.16021.13
5.6.80.0070.17320.54
5.5.350.0170.11720.45
5.5.340.0000.17317.97
5.5.330.0030.18020.13
5.5.320.0370.16720.30
5.5.310.0400.15020.29
5.5.300.0100.17017.91
5.5.290.0070.11317.90
5.5.280.0030.17720.77
5.5.270.0030.13020.76
5.5.260.0130.17320.96
5.5.250.0070.17720.69
5.5.240.4270.10320.37
5.4.450.0600.10719.23
5.4.440.0300.14719.39
5.4.430.0400.15719.20
5.4.420.0300.15719.25
5.4.410.0070.16019.45
5.4.400.0170.16318.92
5.4.390.0330.16719.08
5.4.380.0230.18018.56
5.4.370.0330.18018.66
5.4.360.0330.18718.56
5.4.350.0330.17718.76
5.4.340.0400.16318.51
5.4.320.0140.11612.47
5.4.310.0100.13512.46
5.4.300.0120.12812.46
5.4.290.0060.12712.46
5.4.280.0090.12712.36
5.4.270.0060.13012.36
5.4.260.0090.12012.36
5.4.250.0060.12112.36
5.4.240.0090.12212.36
5.4.230.0060.13812.35
5.4.220.0070.12512.35
5.4.210.0120.12512.35
5.4.200.0080.13612.35
5.4.190.0070.12312.35
5.4.180.0090.12312.35
5.4.170.0080.11812.36
5.4.160.0090.12312.36
5.4.150.0070.12112.35
5.4.140.0080.12712.04
5.4.130.0080.11612.02
5.4.120.0090.12511.98
5.4.110.0120.12811.98
5.4.100.0070.12311.97
5.4.90.0060.11911.98
5.4.80.0070.12911.98
5.4.70.0070.12311.97
5.4.60.0100.13411.97
5.4.50.0060.11911.97
5.4.40.0070.12111.96
5.4.30.0060.12411.96
5.4.20.0040.11811.96
5.4.10.0060.11911.96
5.4.00.0040.12411.45
5.3.290.0110.15212.80
5.3.280.0070.13612.71
5.3.270.0080.12812.73
5.3.260.0060.13212.72
5.3.250.0100.13312.71
5.3.240.0040.12712.72
5.3.230.0100.13612.71
5.3.220.0040.13012.68
5.3.210.0090.14212.68
5.3.200.0080.13112.68
5.3.190.0090.14012.68
5.3.180.0060.12512.67
5.3.170.0090.12912.67
5.3.160.0080.13512.67
5.3.150.0060.13012.67
5.3.140.0050.12812.66
5.3.130.0110.13112.66
5.3.120.0070.12812.65
5.3.110.0120.13312.66
5.3.100.0100.13012.12
5.3.90.0070.13212.08
5.3.80.0080.12312.08
5.3.70.0070.13512.07
5.3.60.0050.13012.06
5.3.50.0080.14712.00
5.3.40.0040.12712.00
5.3.30.0080.12111.96
5.3.20.0080.13711.74
5.3.10.0080.13411.70
5.3.00.0090.13111.70
5.2.170.0020.1329.20
5.2.160.0030.1369.20
5.2.150.0070.1369.20
5.2.140.0060.1439.19
5.2.130.0110.1289.16
5.2.120.0090.1519.16
5.2.110.0070.1489.16
5.2.100.0050.1379.16
5.2.90.0050.1419.16
5.2.80.0040.1269.15
5.2.70.0040.1319.15
5.2.60.0050.1379.10
5.2.50.0060.1269.07
5.2.40.0070.1269.05
5.2.30.0100.1259.03
5.2.20.0070.1209.02
5.2.10.0060.1158.96
5.2.00.0060.1398.83
5.1.60.0070.1188.11
5.1.50.0020.1198.11
5.1.40.0040.1198.09
5.1.30.0040.1238.44
5.1.20.0050.1458.46
5.1.10.0050.1328.18
5.1.00.0060.1378.19
5.0.50.0030.1256.67
5.0.40.0060.1336.53
5.0.30.0040.1336.34
5.0.20.0030.1266.30
5.0.10.0090.1286.29
5.0.00.0070.1326.28
4.4.90.0030.1434.78
4.4.80.0060.1244.75
4.4.70.0040.1424.76
4.4.60.0040.1384.75
4.4.50.0020.1274.77
4.4.40.0040.1534.71
4.4.30.0040.1384.76
4.4.20.0020.1364.85
4.4.10.0040.1394.85
4.4.00.0010.1554.76
4.3.110.0040.0894.67
4.3.100.0040.1454.67
4.3.90.0070.1504.63
4.3.80.0010.1644.59
4.3.70.0010.1474.63
4.3.60.0040.1564.63
4.3.50.0080.1354.63
4.3.40.0060.1674.55
4.3.30.0010.1563.35
4.3.20.0010.1523.33
4.3.10.0060.1343.29
4.3.00.0000.15715.00

preferences:
37.28 ms | 401 KiB | 5 Q