3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ ['type' => 'foo'], ]; function hasDependencyTypeLoop(array $dependencies, string $type): bool { foreach ($dependencies as ['type' => $currentType]) { if ($currentType === $type) { return true; } } return false; } function hasDependencyTypeArrayAny(array $dependencies, string $type): bool { return array_any($dependencies, fn() => $currentType === $type); } var_dump(hasDependencyTypeLoop($data, 'foo')); var_dump(hasDependencyTypeArrayAny($data, 'foo'));

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)
8.5.20.0070.00220.27
8.5.10.0080.00816.93
8.5.00.0110.01023.16
8.4.170.0130.01023.94
8.4.160.0130.01121.99
8.4.150.0080.00416.95
8.4.140.0150.00817.61
8.4.130.0110.00517.81
8.4.120.0220.01023.85
8.4.110.0320.00418.01
8.4.100.0180.00417.66
8.4.90.0170.00418.01
8.4.80.0190.00217.96
8.4.70.0190.00617.48
8.4.60.0240.00417.75
8.4.50.0170.00517.43
8.4.40.0210.00217.83
8.4.30.0180.00517.56
8.4.20.0190.00417.56
8.4.10.0160.00617.67
8.3.300.0100.01020.69
8.3.290.0100.01020.63
8.3.280.0020.00114.05
8.3.270.0100.00916.73
8.3.260.0130.00616.69
8.3.250.0050.00416.64
8.3.240.0180.00316.45
8.3.230.0160.00316.75
8.3.220.0140.00516.58
8.3.210.0140.00616.50
8.3.200.0200.00316.64
8.3.190.0160.00316.48
8.3.180.0200.00416.70
8.3.170.0180.00416.27
8.3.160.0210.00416.50
8.3.150.0180.00516.66
8.3.140.0180.00416.09
8.3.130.0160.00516.83
8.3.120.0180.00216.46
8.3.110.0150.00516.46
8.3.100.0200.00416.59
8.3.90.0170.00516.70
8.3.80.0200.00416.56
8.3.70.0200.00516.66
8.3.60.0190.00416.72
8.3.50.0180.00716.36
8.3.40.0200.00217.23
8.3.30.0180.00217.55
8.3.20.0170.00417.45
8.3.10.0110.00617.30
8.3.00.0130.00617.28
8.2.300.0110.00920.25
8.2.290.0130.00416.69
8.2.280.0150.00216.42
8.2.270.0160.00316.52
8.2.260.0150.00516.49
8.2.250.0130.00516.70
8.2.240.0130.00516.36
8.2.230.0170.00116.38
8.2.220.0160.00216.59
8.2.210.0120.00616.64
8.2.200.0160.00316.63
8.2.190.0130.00516.83
8.2.180.0130.00616.50
8.2.170.0160.00417.44
8.2.160.0150.00517.46
8.2.150.0170.00217.65
8.2.140.0160.00417.53
8.2.130.0150.00517.25
8.2.120.0170.00217.72
8.2.110.0120.00617.29
8.2.100.0150.00417.57
8.2.90.0160.00417.73
8.2.80.0200.00317.60
8.2.70.0150.00617.55
8.2.60.0230.00217.78
8.2.50.0180.00517.57
8.2.40.0150.00617.81
8.2.30.0170.00617.59
8.2.20.0240.00717.54
8.2.10.0180.00417.61
8.2.00.0150.00817.82
8.1.340.0110.01121.88

preferences:
31.34 ms | 403 KiB | 5 Q