3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1, 4, 3, 0, 5]; $product = array_reduce($array, function ($c, $v) { return $c * ($v == 0 ? 1 : $v); }, 1); echo $product; $product = array_product(array_filter($array)); echo $product;

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.20.0060.00317.94
8.4.10.0080.00022.30
8.3.150.0140.00717.02
8.3.140.0040.00416.34
8.3.130.0160.00316.42
8.3.120.0090.00918.85
8.3.110.0030.00620.94
8.3.100.0060.01324.06
8.3.90.0000.00826.77
8.3.80.0030.00616.75
8.3.70.0110.00418.43
8.3.60.0090.00918.30
8.3.50.0080.00924.40
8.3.40.0170.00018.81
8.3.30.0110.00318.63
8.3.20.0050.00324.18
8.3.10.0000.00824.66
8.3.00.0030.00526.16
8.2.270.0030.01417.25
8.2.260.0000.00819.04
8.2.250.0080.00016.75
8.2.240.0080.00018.76
8.2.230.0060.00322.58
8.2.220.0030.00637.54
8.2.210.0000.01426.77
8.2.200.0100.00316.50
8.2.190.0070.01116.63
8.2.180.0100.01025.92
8.2.170.0140.00718.95
8.2.160.0100.00722.96
8.2.150.0000.00825.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00321.08
8.2.110.0060.00322.26
8.2.100.0090.00317.91
8.2.90.0080.00019.05
8.2.80.0040.00418.05
8.2.70.0050.00317.63
8.2.60.0050.00317.63
8.2.50.0030.00618.10
8.2.40.0040.00419.48
8.2.30.0000.00719.26
8.2.20.0000.00718.14
8.2.10.0040.00419.32
8.2.00.0000.00719.19
8.1.310.0080.00018.13
8.1.300.0060.00919.59
8.1.290.0050.00518.88
8.1.280.0140.00725.92
8.1.270.0120.00622.19
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0000.00923.96
8.1.230.0040.00717.83
8.1.220.0050.00317.79
8.1.210.0060.00318.77
8.1.200.0040.00417.48
8.1.190.0040.00417.35
8.1.180.0030.00518.10
8.1.170.0000.00818.71
8.1.160.0000.00819.09
8.1.150.0080.00018.90
8.1.140.0070.00018.77
8.1.130.0000.00720.14
8.1.120.0040.00417.49
8.1.110.0040.00417.38
8.1.100.0000.00717.52
8.1.90.0040.00417.38
8.1.80.0040.00417.37
8.1.70.0030.00317.51
8.1.60.0050.00317.60
8.1.50.0050.00317.42
8.1.40.0040.00417.52
8.1.30.0000.00917.66
8.1.20.0000.00817.55
8.1.10.0080.00017.48
8.1.00.0000.00817.45
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0050.00318.48
8.0.270.0040.00416.88
8.0.260.0060.00018.52
8.0.250.0040.00416.93
8.0.240.0030.00316.87
8.0.230.0000.00716.80
8.0.220.0070.00316.80
8.0.210.0040.00416.73
8.0.200.0000.00716.83
8.0.190.0020.00516.85
8.0.180.0070.00016.84
8.0.170.0000.00816.80
8.0.160.0000.00817.00
8.0.150.0040.00416.88
8.0.140.0060.00316.84
8.0.130.0000.00513.34
8.0.120.0000.00716.88
8.0.110.0070.00016.94
8.0.100.0080.00016.73
8.0.90.0000.00816.89
8.0.80.0080.01016.88
8.0.70.0070.00016.93
8.0.60.0040.00416.96
8.0.50.0030.00516.80
8.0.30.0090.00917.06
8.0.20.0050.01416.99
8.0.10.0040.00416.89
8.0.00.0110.01116.93
7.4.330.0000.00515.55
7.4.320.0060.00016.57
7.4.300.0060.00016.52
7.4.290.0050.00316.52
7.4.280.0070.00016.49
7.4.270.0030.00616.52
7.4.260.0020.00213.27
7.4.250.0040.00416.40
7.4.240.0030.00316.51
7.4.230.0050.00216.39
7.4.220.0000.00716.68
7.4.210.0100.00516.54
7.4.200.0050.00216.44
7.4.130.0110.00916.41
7.4.120.0110.01216.56
7.4.110.0100.00716.66
7.4.100.0040.01216.47
7.4.90.0120.00916.53
7.4.80.0160.00819.39
7.4.70.0150.00616.39
7.4.60.0090.01315.94
7.4.50.0040.02016.49
7.4.40.0100.01216.18
7.4.30.0120.01216.38
7.4.20.0090.01116.53
7.4.10.0080.01116.17
7.4.00.0150.00916.44
7.3.330.0030.00416.29
7.3.320.0030.00313.28
7.3.310.0030.00316.37
7.3.300.0000.00716.36
7.3.290.0080.01016.33
7.3.260.0040.01816.23
7.3.240.0100.01016.43
7.3.230.0040.01416.13
7.3.210.0140.00716.24
7.3.200.0030.01316.48
7.3.190.0090.01216.47
7.3.180.0130.00416.36
7.3.170.0130.00915.89
7.3.160.0110.00816.55
7.3.150.0110.01116.27
7.3.140.0200.00316.41
7.3.130.0060.01516.08
7.3.120.0180.00316.24
7.3.110.0080.01116.45
7.3.100.0110.01516.43
7.3.90.0100.01416.37
7.3.80.0170.00516.35
7.3.70.0070.01116.31
7.3.60.0090.01116.13
7.3.50.0180.00016.22
7.3.40.0040.01916.32
7.3.30.0140.00316.24
7.3.20.0100.01016.25
7.3.10.0040.01416.30
7.3.00.0100.01416.35
7.2.330.0090.00816.73
7.2.320.0030.01416.39
7.2.310.0140.00716.14
7.2.300.0100.01416.53
7.2.290.0090.00916.81
7.2.280.0110.01316.57
7.2.270.0130.00616.59
7.2.260.0040.01416.42
7.2.250.0090.01316.27
7.2.240.0120.01116.36
7.2.230.0090.01016.68
7.2.220.0100.01016.54
7.2.210.0090.00916.70
7.2.200.0130.00616.69
7.2.190.0120.00916.30
7.2.180.0120.00916.74
7.2.170.0190.00316.39
7.2.160.0100.01416.62
7.2.150.0120.01216.35
7.2.140.0170.00316.52
7.2.130.0070.01416.55
7.2.120.0130.00816.70
7.2.110.0130.01016.48
7.2.100.0170.00716.65
7.2.90.0180.00016.66
7.2.80.0060.01116.57
7.2.70.0140.00716.54
7.2.60.0130.00916.47
7.2.50.0050.01616.41
7.2.40.0060.01616.73
7.2.30.0150.01016.71
7.2.20.0100.01016.67
7.2.10.0140.01016.52
7.2.00.0120.00916.57

preferences:
26.83 ms | 403 KiB | 5 Q