3v4l.org

run code in 300+ PHP versions simultaneously
<?php function agefilter($item) { return ($item['age'] == 21); } $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_filter($a, 'agefilter'); $time = microtime(true) - $time; echo 'callback took ' . 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.2.00.5310.03077.30
7.1.70.0590.02675.00
7.1.60.0300.05075.16
7.1.50.0130.02375.05
7.1.00.0070.10780.33
7.0.200.1980.02773.34
7.0.140.0130.10079.93
7.0.101.0230.10377.75
7.0.90.9130.10077.68
7.0.80.8900.10077.79
7.0.70.9600.05377.70
7.0.60.5330.07777.77
7.0.51.0030.10078.11
7.0.40.2030.10727.93
7.0.30.2030.10027.94
7.0.20.1970.06727.96
7.0.10.1830.10727.84
7.0.00.1870.10327.93
5.6.280.0270.14785.45
5.6.250.0400.14085.10
5.6.240.0470.11785.13
5.6.230.0130.14785.21
5.6.220.0300.13085.21
5.6.210.0470.11785.30
5.6.200.0200.14385.64
5.6.190.0470.13385.55
5.6.180.0270.15085.45
5.6.170.0300.14385.57
5.6.160.0130.14785.57
5.6.150.0370.12385.58
5.6.140.0030.14385.57
5.6.130.0300.14085.47
5.6.120.0470.13785.59
5.6.110.0230.15385.65
5.6.100.0270.14085.63
5.6.90.0300.14385.44
5.6.80.0270.15084.98
5.6.70.0530.14084.93
5.6.60.0400.13784.94
5.6.50.0270.14085.05
5.6.40.0300.14384.92
5.6.30.0270.15384.98
5.6.20.0270.13084.87
5.6.10.0330.12784.93
5.6.00.0270.10784.94
5.5.380.0230.14785.02
5.5.370.0230.14785.10
5.5.360.0230.18384.89
5.5.350.0370.12784.92
5.5.340.0200.15085.26
5.5.330.0300.13385.45
5.5.320.0100.16785.36
5.5.310.0230.15385.41
5.5.300.0370.16785.17
5.5.290.0370.15085.40
5.5.280.0470.12085.41
5.5.270.0270.14385.44
5.5.260.0270.15385.32
5.5.250.0570.11085.11
5.5.240.0330.15384.85
5.5.230.0300.14784.54
5.5.220.0370.13384.66
5.5.210.0370.14084.80
5.5.200.0170.11384.71
5.5.190.0230.14384.77
5.5.180.0270.13784.64
5.5.160.0230.15384.77
5.5.150.0330.14784.74
5.5.140.0230.13784.74
5.5.130.0600.11784.62
5.5.120.0170.15784.64
5.5.110.0300.14784.64
5.5.100.0300.14084.62
5.5.90.0370.12084.60
5.5.80.0200.15084.57
5.5.70.0300.14784.57
5.5.60.0270.13784.61
5.5.50.0230.14784.63
5.5.40.0370.13784.61
5.5.30.0070.13384.59
5.5.20.0400.13084.61
5.5.10.0370.14084.60
5.5.00.0370.14084.56
5.4.450.0270.13783.64
5.4.440.0400.13784.00
5.4.430.0230.14783.76
5.4.420.0300.15083.67
5.4.410.0170.13783.68
5.4.400.0330.16083.30
5.4.390.0370.14083.52
5.4.380.0270.14783.53
5.4.370.0330.14383.41
5.4.360.0300.14383.58
5.4.350.0270.11783.47
5.4.340.0270.12383.64
5.4.320.0300.12383.52
5.4.310.0430.14383.32
5.4.300.0400.13383.51
5.4.290.0200.13783.64
5.4.280.0100.14783.46
5.4.270.0470.10383.58
5.4.260.0270.13783.63
5.4.250.0500.12383.34
5.4.240.0430.11783.48
5.4.230.0270.16083.46
5.4.220.0400.12383.64
5.4.210.0300.13083.50
5.4.200.0330.14083.57
5.4.190.0100.16083.34
5.4.180.0270.14083.48
5.4.170.0200.15783.46
5.4.160.0230.15083.45
5.4.150.0170.09783.47
5.4.140.0300.14080.85
5.4.130.0300.13780.94
5.4.120.0170.14380.84
5.4.110.0170.13780.89
5.4.100.0070.15780.83
5.4.90.0200.10780.97
5.4.80.0230.15081.00
5.4.70.0530.12780.94
5.4.60.0370.12780.91
5.4.50.0170.13780.93
5.4.40.0330.12380.79
5.4.30.0330.11780.91
5.4.20.0170.15080.86
5.4.10.0300.13080.75
5.4.00.0130.14080.41
5.3.290.0230.14077.65
5.3.280.0200.14777.68
5.3.270.0130.13777.66
5.3.260.0270.15777.62
5.3.250.0200.12377.60
5.3.240.0170.14077.61
5.3.230.0200.09777.61
5.3.220.0230.13377.62
5.3.210.0300.13377.50
5.3.200.0430.13077.49
5.3.190.0170.14777.62
5.3.180.0230.14377.63
5.3.170.0130.16077.48
5.3.160.0370.14777.49
5.3.150.0300.10077.54
5.3.140.0200.14377.64
5.3.130.0200.13377.60
5.3.120.0230.13377.49
5.3.110.0400.11077.58
5.3.100.0300.10777.04
5.3.90.0370.15777.12
5.3.80.0300.13076.96
5.3.70.0130.15376.95
5.3.60.0200.14076.93
5.3.50.0170.16376.84
5.3.40.0270.14777.01
5.3.30.0100.16076.80
5.3.20.0370.15376.58
5.3.10.0270.11376.58
5.3.00.0130.11376.54
5.2.170.0270.13374.69
5.2.160.0400.12774.59
5.2.150.0170.14374.74
5.2.140.0230.15074.46
5.2.130.0300.13774.55
5.2.120.0200.15775.32
5.2.110.0130.15374.63
5.2.100.0200.15074.42
5.2.90.0230.13774.54
5.2.80.0270.13374.50
5.2.70.0430.13374.54
5.2.60.0200.15374.59
5.2.50.0200.14374.73
5.2.40.0270.10774.62
5.2.30.0100.12074.64
5.2.20.0200.11374.71
5.2.10.0170.08375.08
5.2.00.0570.187158.89
5.1.60.0530.227204.07
5.1.50.0600.280204.20
5.1.40.0530.253204.05
5.1.30.0570.227204.52
5.1.20.0670.237204.53
5.1.10.0500.273204.25
5.1.00.0570.260204.24
5.0.50.0400.290202.48
5.0.40.0370.320202.49
5.0.30.0400.340202.38
5.0.20.0470.327202.29
5.0.10.0600.310202.13
5.0.00.0530.347202.42
4.4.90.0600.327200.13
4.4.80.0400.380200.11
4.4.70.0400.307200.11
4.4.60.0600.317200.14
4.4.50.0570.270200.17
4.4.40.0530.337200.07
4.4.30.0530.317200.12
4.4.20.0330.297200.14
4.4.10.0600.313200.15
4.4.00.0330.253200.13
4.3.110.0330.303200.00
4.3.100.0500.320199.96
4.3.90.0500.350199.96
4.3.80.0370.360200.02
4.3.70.0600.350200.03
4.3.60.0400.340200.01
4.3.50.0530.357200.01
4.3.40.0530.343199.95
4.3.30.0700.337198.76
4.3.20.0630.323198.68
4.3.10.0330.340198.68
4.3.00.0930.377198.66

preferences:
36.11 ms | 400 KiB | 5 Q