3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(); for ($i = 0; $i < 200000; $i++) { $a[] = array( 'name' => 'John', 'city' => 'New York', 'age' => $i % 200 == 0 ? 21 : 28 ); } $time = microtime(true); $filtered = array(); foreach ($a as $item) { if ($item['age'] == 21) $filtered[] = $item; } $time = microtime(true) - $time; echo 'explicit foreach ' . number_format($time, 3) . ' seconds and returned ' . count($filtered) . " entries\n";

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.3.10.1860.01774.54
7.3.00.0830.04574.27
7.2.130.2310.02673.90
7.2.120.1570.03774.77
7.2.110.1300.02674.52
7.2.100.1200.03674.73
7.2.90.0610.02774.70
7.2.80.1360.02074.65
7.2.70.1360.03774.52
7.2.60.0840.02675.00
7.2.50.0370.00311.88
7.2.40.1390.02675.02
7.2.30.1320.03774.92
7.2.20.1290.02174.68
7.2.10.1500.03574.93
7.2.00.0760.02676.14
7.1.250.1050.05173.53
7.1.70.0370.02075.16
7.1.60.0260.04575.21
7.1.50.0070.02875.15
7.1.00.0130.10080.21
7.0.200.1240.03473.02
7.0.140.0170.09080.07
7.0.60.0170.07777.76
7.0.50.0030.08375.57
7.0.40.0130.06327.68
7.0.30.0600.10727.63
7.0.20.0400.08327.62
7.0.10.0200.05327.73
7.0.00.0030.12727.58
5.6.280.0270.15085.67
5.6.210.0570.09385.11
5.6.200.0200.16382.61
5.6.190.0200.10784.69
5.6.180.0370.09784.89
5.6.170.0500.09384.88
5.6.160.0300.15084.88
5.6.150.0500.13782.69
5.6.140.0200.17082.68
5.6.130.0230.14382.57
5.6.120.0370.13785.56
5.6.110.0130.18085.53
5.6.100.0330.16385.53
5.6.90.0430.10785.52
5.6.80.0330.14384.96
5.6.70.4400.10085.00
5.5.350.0470.15084.98
5.5.340.0130.10382.41
5.5.330.0200.11384.72
5.5.320.0570.10084.43
5.5.310.0530.11384.62
5.5.300.0270.16082.41
5.5.290.0330.13382.49
5.5.280.0130.15085.42
5.5.270.0270.13385.39
5.5.260.0400.15385.46
5.5.250.0330.12085.07
5.5.240.4400.09384.56
5.4.450.1200.16784.07
5.4.440.0770.12383.69
5.4.430.0700.17783.68
5.4.420.0600.14383.73
5.4.410.0500.14083.59
5.4.400.0570.13783.56
5.4.390.0670.14383.56
5.4.380.0470.15383.21
5.4.370.0270.11083.22
5.4.360.0400.10383.16
5.4.350.0440.16376.50
5.4.340.0330.11476.49
5.4.320.0290.09976.98
5.4.310.0200.10876.98
5.4.300.0290.10276.98
5.4.290.0250.11776.97
5.4.280.0240.11276.86
5.4.270.0270.10776.87
5.4.260.0310.11776.88
5.4.250.0370.10476.87
5.4.240.0260.12276.87
5.4.230.0240.10776.87
5.4.220.0330.11676.86
5.4.210.0200.10876.86
5.4.200.0260.10776.87
5.4.190.0220.10376.86
5.4.180.0270.09676.86
5.4.170.0260.09776.87
5.4.160.0240.09976.87
5.4.150.0330.09576.87
5.4.140.0230.10376.55
5.4.130.0220.10076.54
5.4.120.0250.11476.50
5.4.110.0280.10876.49
5.4.100.0300.10176.49
5.4.90.0250.10376.49
5.4.80.0240.11676.49
5.4.70.0180.10276.48
5.4.60.0210.12176.48
5.4.50.0290.11276.48
5.4.40.0220.10876.48
5.4.30.0350.10876.47
5.4.20.0230.12576.47
5.4.10.0260.14276.47
5.4.00.0280.14975.96
5.3.290.0310.10975.82
5.3.280.0290.12275.75
5.3.270.0250.12475.77
5.3.260.0490.14175.77
5.3.250.0310.11775.77
5.3.240.0200.12775.77
5.3.230.0340.11875.76
5.3.220.0290.11975.73
5.3.210.0250.10675.73
5.3.200.0230.10375.72
5.3.190.0350.11675.73
5.3.180.0250.10275.72
5.3.170.0320.11175.73
5.3.160.0270.13075.72
5.3.150.0280.11375.73
5.3.140.0160.11975.71
5.3.130.0210.12075.71
5.3.120.0280.11075.71
5.3.110.0190.11775.71
5.3.100.0260.10575.20
5.3.90.0220.10975.18
5.3.80.0340.10875.43
5.3.70.0300.10775.43
5.3.60.0160.11675.41
5.3.50.0190.12175.10
5.3.40.0240.11075.10
5.3.30.0190.11475.06
5.3.20.0290.11674.84
5.3.10.0170.11574.81
5.3.00.0230.11075.05
5.2.170.0260.10272.83
5.2.160.0220.10672.83
5.2.150.0240.10772.83
5.2.140.0310.10272.82
5.2.130.0240.13072.79
5.2.120.0300.11572.79
5.2.110.0240.10772.79
5.2.100.0260.10672.79
5.2.90.0290.10872.79
5.2.80.0190.11172.78
5.2.70.0240.10572.78
5.2.60.0150.11872.73
5.2.50.0250.13572.93
5.2.40.0210.14372.91
5.2.30.0240.13672.63
5.2.20.0240.14372.88
5.2.10.0140.10572.80
5.2.00.0540.198157.22
5.1.60.0600.254202.29
5.1.50.0590.276202.29
5.1.40.0570.268202.27
5.1.30.0570.276202.62
5.1.20.0800.334202.64
5.1.10.0690.287202.36
5.1.00.0680.281202.37
5.0.50.0560.349200.85
5.0.40.0600.325200.70
5.0.30.0570.356200.52
5.0.20.0780.357200.49
5.0.10.0630.341200.46
5.0.00.0640.363200.46
4.4.90.0760.348199.40
4.4.80.0660.342199.39
4.4.70.0630.350199.38
4.4.60.0680.363199.39
4.4.50.0560.349199.40
4.4.40.0580.381199.39
4.4.30.0560.375199.39
4.4.20.0380.400199.45
4.4.10.0490.369199.45
4.4.00.0580.399199.42
4.3.110.0550.373199.33
4.3.100.0510.358199.31
4.3.90.0450.352198.78
4.3.80.0480.358198.78
4.3.70.0510.364198.78
4.3.60.0520.384198.78
4.3.50.0560.426198.77
4.3.40.0590.396198.74
4.3.30.0580.396197.55
4.3.20.0610.345197.52
4.3.10.0500.406197.48
4.3.00.1570.593198.66

preferences:
46.14 ms | 400 KiB | 5 Q