3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!function_exists('array_find_key')) { function array_find_key(array $array, callable $callback) { foreach ($array as $key => $value) { if ($callback($value, $key)) { return $key; } } return null; } } $testcase = [ "['foo', 1]" => ['foo', 1], "['foo' => 1]" => ['foo' => 1], "['foo' => 'bar']" => ['foo' => 'bar'], ]; echo json_encode(array_map(fn ($a) => array_find_key($a, fn ($v) => is_int($v)), $testcase), JSON_PRETTY_PRINT);

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.00.0130.00819.89
8.4.150.0030.00014.05
8.4.140.0140.00717.47
8.4.130.0060.00217.53
8.4.120.0140.00523.87
8.4.110.0070.00221.24
8.4.100.0120.00717.84
8.4.90.0040.00520.38
8.4.80.0100.01020.46
8.4.70.0050.00318.88
8.4.60.0050.01620.44
8.4.50.0150.00820.57
8.4.40.0130.00718.54
8.4.30.0040.01525.57
8.4.20.0140.00719.82
8.4.10.0060.00319.39
8.3.280.0100.01018.26
8.3.270.0150.01116.48
8.3.260.0130.00617.13
8.3.250.0100.01018.79
8.3.240.0140.00517.01
8.3.230.0130.00816.46
8.3.220.0130.00620.87
8.3.210.0090.00616.57
8.3.200.0110.01016.57
8.3.190.0040.00417.16
8.3.180.0050.00518.81
8.3.170.0100.01017.36
8.3.160.0110.00720.61
8.3.150.0060.00918.94
8.3.140.0080.00018.45
8.3.130.0080.00016.65
8.3.120.0450.00716.14
8.3.110.0320.01616.34
8.3.100.0380.00316.41
8.3.90.0240.00016.50
8.3.80.0240.00616.32
8.3.70.0180.00718.43
8.3.60.0200.00516.55
8.3.50.0260.00016.32
8.3.40.0110.00817.33
8.3.30.0180.00317.11
8.3.20.0220.00017.23
8.3.10.0140.00517.33
8.3.00.0120.01217.36
8.2.290.0140.00420.35
8.2.280.0050.00318.26
8.2.270.0040.01116.55
8.2.260.0050.00317.30
8.2.250.0050.00318.66
8.2.240.0120.00916.13
8.2.230.0180.00316.55
8.2.220.0260.00416.29
8.2.210.0150.00616.23
8.2.200.0210.00016.36
8.2.190.0140.00716.37
8.2.180.0160.00616.18
8.2.170.0200.00217.61
8.2.160.0150.00817.40
8.2.150.0210.00017.57
8.2.140.0180.00517.54
8.2.130.0160.00716.95
8.2.120.0200.00217.19
8.2.110.0150.00919.39
8.2.100.0190.00217.39
8.2.90.0180.00417.52
8.2.80.0150.00817.25
8.2.70.0200.00617.22
8.2.60.0190.00417.18
8.2.50.0170.00617.11
8.2.40.0160.00417.18
8.2.30.0120.00817.36
8.2.20.0180.00417.23
8.2.10.0190.00517.31
8.2.00.0180.00317.57
8.1.330.0140.00421.93
8.1.320.0050.00417.85
8.1.310.0070.00018.41
8.1.300.0220.00015.99
8.1.290.0220.00015.71
8.1.280.0150.00615.90
8.1.270.0170.00617.25
8.1.260.0230.00017.19
8.1.250.0230.00017.18
8.1.240.0210.00317.15
8.1.230.0130.00717.17
8.1.220.0180.00317.18
8.1.210.0130.00717.10
8.1.200.0140.00517.15
8.1.190.0180.00317.04
8.1.180.0180.00317.29
8.1.170.0160.00617.05
8.1.160.0100.01017.24
8.1.150.0130.00617.00
8.1.140.0190.00017.18
8.1.130.0210.00016.85
8.1.120.0200.00017.13
8.1.110.0160.00417.20
8.1.100.0130.00617.14
8.1.90.0130.00717.13
8.1.80.0170.00618.84
8.1.70.0130.00718.87
8.1.60.0180.00417.31
8.1.50.0220.00017.28
8.1.40.0200.00017.45
8.1.30.0220.00017.25
8.1.20.0190.00517.32
8.1.10.0140.00717.28
8.1.00.0150.00617.22

preferences:
29.62 ms | 403 KiB | 5 Q