3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [10, 2, 5, 10, 0]; $b = [1, 20, 11, 8, 3]; var_export( array_reduce( array_keys($b), fn ($result, $k) => array_replace($result, [$k => ($result[$k] ?? 0) + $b[$k]]), $a ) );

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.4.140.0150.00617.65
8.4.130.0150.00517.73
8.4.120.0130.00720.57
8.4.110.0090.01220.61
8.4.100.0120.00817.53
8.4.90.0120.00820.35
8.4.80.0100.00818.96
8.4.70.0090.01020.56
8.4.60.0070.00520.49
8.4.50.0160.00519.63
8.4.40.0150.00617.40
8.4.30.0060.01218.73
8.4.20.0060.01318.04
8.4.10.0090.00019.44
8.3.270.0110.00816.64
8.3.260.0080.01216.46
8.3.250.0070.00218.79
8.3.240.0120.00716.57
8.3.230.0050.00416.81
8.3.220.0020.00519.02
8.3.210.0050.00316.61
8.3.200.0070.00216.59
8.3.190.0110.00817.20
8.3.180.0090.01016.72
8.3.170.0050.00320.81
8.3.160.0070.01117.13
8.3.150.0130.00619.22
8.3.140.0030.00617.46
8.3.130.0050.00318.27
8.3.120.0030.00620.66
8.3.110.0120.00020.94
8.3.100.0060.00318.42
8.3.90.0050.00326.77
8.3.80.0080.00316.62
8.3.70.0120.00916.37
8.3.60.0090.00616.63
8.3.50.0150.00318.35
8.3.40.0070.00723.79
8.3.30.0120.00320.07
8.3.20.0000.00824.18
8.3.10.0120.00621.80
8.3.00.0150.00318.93
8.2.290.0070.01220.54
8.2.280.0080.01120.08
8.2.270.0070.01119.02
8.2.260.0110.00318.62
8.2.250.0120.00916.54
8.2.240.0060.00317.24
8.2.230.0030.00622.58
8.2.220.0060.00324.06
8.2.210.0030.00526.77
8.2.200.0040.00718.16
8.2.190.0080.00816.63
8.2.180.0070.01418.41
8.2.170.0080.00822.96
8.2.160.0040.01122.96
8.2.150.0050.00325.66
8.2.140.0060.01020.34
8.2.130.0030.00620.57
8.2.120.0130.00619.10
8.2.110.0040.01419.07
8.2.100.0160.00319.01
8.2.90.0120.00618.96
8.2.80.0070.01119.21
8.2.70.0180.00018.91
8.2.60.0180.00318.75
8.2.50.0070.00718.72
8.2.40.0080.00818.96
8.2.30.0050.00318.82
8.2.20.0180.00018.70
8.2.10.0000.00918.65
8.2.00.0130.00718.65
8.1.330.0150.00416.24
8.1.320.0120.00716.03
8.1.310.0040.01416.76
8.1.300.0080.01217.80
8.1.290.0060.00330.84
8.1.280.0090.00625.92
8.1.270.0090.00922.19
8.1.260.0110.00421.84
8.1.250.0090.00622.06
8.1.240.0040.01118.37
8.1.230.0130.00318.62
8.1.220.0070.00718.91
8.1.210.0140.00718.51
8.1.200.0060.00918.93
8.1.190.0040.01118.43
8.1.180.0030.01718.57
8.1.170.0100.01018.52
8.1.160.0150.00618.52
8.1.150.0090.00618.46
8.1.140.0100.01018.56
8.1.130.0110.00418.77
8.1.120.0090.00618.68
8.1.110.0100.00618.58
8.1.100.0090.00618.59
8.1.90.0040.01218.55
8.1.80.0000.01618.55
8.1.70.0100.00718.59
8.1.60.0130.00318.70
8.1.50.0000.00818.59
8.1.40.0000.00818.76
8.1.30.0150.00318.85
8.1.20.0110.00018.78
8.1.10.0030.00618.60
8.1.00.0030.00718.53

preferences:
28.91 ms | 403 KiB | 5 Q