3v4l.org

run code in 300+ PHP versions simultaneously
<?php function modify_in_place($prices) { $prices[0] = 100; } function modify_location($prices) { $prices = [40, 50, 60]; } $prices = [1, 2, 3]; modify_in_place($prices); echo (bool)($prices[0] == 100); //failed! pass-by-value $prices = [1, 2, 3]; modify_location($prices); assert($prices[0] == 40); //failed! pass-by-value

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.3.40.0120.00318.83
8.3.30.0070.00718.82
8.3.20.0100.00720.20
8.3.10.0080.00022.07
8.3.00.0080.00319.68
8.2.170.0120.00322.96
8.2.160.0100.00320.38
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0030.00617.75
8.2.110.0000.00822.20
8.2.100.0080.00417.88
8.2.90.0000.00819.29
8.2.80.0000.00817.97
8.2.70.0060.00317.63
8.2.60.0000.00817.93
8.2.50.0050.00618.07
8.2.40.0040.00421.07
8.2.30.0030.00619.82
8.2.20.0000.00717.70
8.2.10.0030.00518.13
8.2.00.0040.00418.05
8.1.270.0040.00420.25
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00322.46
8.1.230.0040.00817.42
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0070.00317.22
8.1.190.0030.00617.35
8.1.180.0050.00318.10
8.1.170.0000.00818.64
8.1.160.0050.00321.93
8.1.150.0040.00418.93
8.1.140.0040.00417.36
8.1.130.0000.00717.77
8.1.120.0070.00017.50
8.1.110.0040.00417.38
8.1.100.0000.00717.32
8.1.90.0000.00717.38
8.1.80.0070.00017.46
8.1.70.0040.00417.52
8.1.60.0050.00217.61
8.1.50.0030.00517.52
8.1.40.0030.00517.54
8.1.30.0110.00617.72
8.1.20.0000.00817.64
8.1.10.0050.00217.65
8.1.00.0040.00417.45
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0030.00318.50
8.0.270.0050.00317.30
8.0.260.0030.00317.27
8.0.250.0070.00017.04
8.0.240.0060.00016.96
8.0.230.0030.00417.04
8.0.220.0000.00716.95
8.0.210.0040.00416.99
8.0.200.0030.00317.04
8.0.190.0000.00817.06
8.0.180.0030.00516.88
8.0.170.0070.00016.98
8.0.160.0030.00516.93
8.0.150.0040.00416.88
8.0.140.0000.00716.90
8.0.130.0050.00013.43
8.0.120.0050.00316.90
8.0.110.0040.00416.88
8.0.100.0040.00416.92
8.0.90.0050.00216.82
8.0.80.0090.00616.86
8.0.70.0040.00416.72
8.0.60.0000.00717.01
8.0.50.0030.00516.91
8.0.30.0140.00717.00
8.0.20.0100.00817.40
8.0.10.0050.00316.97
8.0.00.0090.00916.97
7.4.330.0030.00315.08
7.4.320.0030.00316.54
7.4.300.0000.00616.61
7.4.290.0030.00316.41
7.4.280.0070.00016.50
7.4.270.0040.00416.46
7.4.260.0070.00016.64
7.4.250.0030.00316.43
7.4.240.0050.00216.52
7.4.230.0070.00016.50
7.4.220.0090.00916.55
7.4.210.0150.00616.55
7.4.200.0000.00716.70
7.4.160.0170.00716.37
7.4.150.0070.01117.40
7.4.140.0110.00817.86
7.4.130.0110.01016.59
7.4.120.0070.01516.51
7.4.110.0140.00316.68
7.4.100.0130.00316.62
7.4.90.0040.01216.64
7.4.80.0070.01319.39
7.4.70.0100.00716.56
7.4.60.0140.00316.40
7.4.50.0040.00416.55
7.4.40.0100.01016.66
7.4.30.0160.00316.48
7.4.00.0030.01214.89
7.3.330.0000.00613.50
7.3.320.0000.00513.27
7.3.310.0030.00316.41
7.3.300.0000.00616.43
7.3.290.0100.00616.41
7.3.280.0070.01116.39
7.3.270.0070.01117.40
7.3.260.0190.00016.36
7.3.250.0100.00716.34
7.3.240.0060.01216.37
7.3.230.0100.00716.41
7.3.210.0070.01016.50
7.3.200.0140.00616.64
7.3.190.0060.01116.27
7.3.180.0060.01016.68
7.3.170.0150.00416.61
7.3.160.0130.00316.38
7.2.330.0110.00616.54
7.2.320.0120.00916.81
7.2.310.0100.01316.78
7.2.300.0130.01016.52
7.2.290.0110.01116.43
7.2.60.0080.00816.88
7.2.00.0040.01119.52
7.1.200.0000.01315.98
7.1.100.0000.01418.01
7.1.70.0040.00417.23
7.1.60.0090.01220.03
7.1.50.0030.02016.76
7.1.00.0100.07022.40
7.0.200.0100.00714.97
7.0.60.0100.08719.92
7.0.50.0030.04717.88
7.0.40.0070.04320.18
7.0.30.0600.07020.10
7.0.20.0230.05020.09
7.0.10.0300.09320.26
7.0.00.0170.04020.07
5.6.280.0000.06720.89
5.6.210.0100.04320.61
5.6.200.0030.04018.15
5.6.190.0130.07320.33
5.6.180.0370.07020.66
5.6.170.0270.06320.56
5.6.160.0030.04320.54
5.6.150.0170.07318.18
5.6.140.0030.05318.14
5.6.130.0070.08318.27
5.6.120.0030.09020.89
5.6.110.0070.09321.05
5.6.100.0000.07721.04
5.6.90.0130.07720.98
5.6.80.0000.04020.41
5.6.70.0130.04020.53
5.5.350.0130.08720.40
5.5.340.0030.04018.02
5.5.330.0100.04720.47
5.5.320.0170.04320.27
5.5.310.0300.06020.19
5.5.300.0070.06318.08
5.5.290.0070.05318.01
5.5.280.0070.08020.87
5.5.270.0100.03720.97
5.5.260.0070.08320.89
5.5.250.0170.07020.76
5.5.240.0030.04020.19
5.4.450.0230.03719.23
5.4.440.0200.04019.57
5.4.430.0170.04719.38
5.4.420.0200.03719.30
5.4.410.0200.03319.14
5.4.400.0200.04019.36
5.4.390.0270.06019.20
5.4.380.0200.03719.06
5.4.370.0200.03318.98
5.4.360.0200.04319.24
5.4.350.0230.06319.19
5.4.340.0230.04318.94
5.4.320.0330.06318.86
5.4.310.0200.04319.21
5.4.300.0300.06318.87
5.4.290.0230.05019.22
5.4.280.0370.06319.10
5.4.270.0370.07019.09
5.4.260.0230.04018.98
5.4.250.0300.07719.20
5.4.240.0300.07018.81
5.4.230.0370.06319.14
5.4.220.0330.06718.97
5.4.210.0270.04318.98
5.4.200.0300.03319.15
5.4.190.0330.04318.94
5.4.180.0330.06318.95
5.4.170.0230.04019.21
5.4.160.0300.05319.19
5.4.150.0230.05019.30
5.4.140.0300.06316.43
5.4.130.0270.06316.56
5.4.120.0270.04316.46
5.4.110.0300.07016.34
5.4.100.0400.06016.63
5.4.90.0400.06016.32
5.4.80.0330.05716.44

preferences:
45.35 ms | 400 KiB | 5 Q