3v4l.org

run code in 300+ PHP versions simultaneously
<?php function modify_in_place_by_ref(&$prices) { $prices[0] = 100; } function modify_location_by_ref(&$prices) { $prices = [40, 50, 60]; } $prices = [1, 2, 3]; modify_in_place_by_ref($prices); if ($prices[0] == 100) { echo "Pass-by-reference!\n"; // Yep } else { echo "Pass-by-value!\n"; } $prices = [1, 2, 3]; modify_location($prices); if ($prices[0] == 40) { echo "Pass-by-reference!\n"; // Yep } else { echo "Pass-by-value!\n"; }

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.60.0070.01016.63
8.3.50.0200.00221.16
8.3.40.0130.00318.83
8.3.30.0070.00718.84
8.3.20.0000.00820.34
8.3.10.0080.00021.49
8.3.00.0080.00019.81
8.2.180.0090.00625.92
8.2.170.0120.00322.96
8.2.160.0100.00320.39
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0060.00317.72
8.2.110.0090.00022.29
8.2.100.0110.00017.63
8.2.90.0060.00319.20
8.2.80.0030.00517.97
8.2.70.0100.00017.75
8.2.60.0040.00418.05
8.2.50.0090.00218.07
8.2.40.0050.00321.10
8.2.30.0040.00419.75
8.2.20.0000.00817.66
8.2.10.0070.00018.06
8.2.00.0050.00218.05
8.1.280.0140.00325.92
8.1.270.0070.00020.32
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00022.54
8.1.230.0040.00717.48
8.1.220.0030.00617.74
8.1.210.0090.00018.77
8.1.200.0030.00717.47
8.1.190.0030.00617.35
8.1.180.0080.00018.10
8.1.170.0040.00418.53
8.1.160.0000.00721.98
8.1.150.0080.00018.89
8.1.140.0000.00817.37
8.1.130.0050.00217.63
8.1.120.0040.00417.36
8.1.110.0040.00417.39
8.1.100.0040.00417.38
8.1.90.0070.00017.48
8.1.80.0070.00017.45
8.1.70.0040.00417.37
8.1.60.0040.00417.63
8.1.50.0030.00517.52
8.1.40.0080.00017.58
8.1.30.0090.00017.68
8.1.20.0000.00817.57
8.1.10.0040.00417.59
8.1.00.0040.00417.44
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0080.00018.43
8.0.270.0000.00717.10
8.0.260.0030.00317.21
8.0.250.0040.00416.85
8.0.240.0000.00716.95
8.0.230.0040.00416.91
8.0.220.0040.00416.79
8.0.210.0030.00516.89
8.0.200.0000.00617.01
8.0.190.0000.00816.79
8.0.180.0050.00216.93
8.0.170.0040.00416.94
8.0.160.0040.00416.78
8.0.150.0040.00416.71
8.0.140.0000.00816.74
8.0.130.0000.00613.25
8.0.120.0040.00416.81
8.0.110.0000.00717.00
8.0.100.0040.00416.82
8.0.90.0040.00416.85
8.0.80.0100.00716.83
8.0.70.0030.00516.93
8.0.60.0000.00716.92
8.0.50.0040.00416.88
8.0.30.0040.01517.07
8.0.20.0070.01217.40
8.0.10.0000.00816.88
8.0.00.0120.00716.93
7.4.330.0000.00515.13
7.4.320.0030.00316.64
7.4.300.0030.00316.65
7.4.290.0030.00316.53
7.4.280.0070.00316.49
7.4.270.0030.00316.52
7.4.260.0070.00016.58
7.4.250.0070.00016.57
7.4.240.0030.00316.57
7.4.230.0030.00316.67
7.4.220.0030.01416.58
7.4.210.0100.00316.49
7.4.200.0040.00416.50
7.4.160.0160.00016.40
7.4.150.0110.00617.40
7.4.140.0100.01017.86
7.4.130.0080.00916.52
7.4.120.0080.01016.49
7.4.110.0090.00916.63
7.4.100.0090.00916.54
7.4.90.0090.00916.62
7.4.80.0110.01119.39
7.4.70.0070.01016.60
7.4.60.0070.01016.51
7.4.50.0000.00916.55
7.4.40.0110.01116.68
7.4.30.0060.01616.73
7.4.00.0040.01114.74
7.3.330.0050.00013.25
7.3.320.0000.00513.18
7.3.310.0000.00716.30
7.3.300.0000.00716.34
7.3.290.0080.00716.37
7.3.280.0110.00816.34
7.3.270.0060.01117.40
7.3.260.0200.00316.55
7.3.250.0120.00516.34
7.3.240.0090.01316.34
7.3.230.0090.01216.44
7.3.210.0110.00616.50
7.3.200.0030.01316.34
7.3.190.0090.01316.32
7.3.180.0060.01016.36
7.3.170.0060.01416.42
7.3.160.0100.01216.44
7.2.330.0180.00416.66
7.2.320.0150.00616.42
7.2.310.0070.01016.67
7.2.300.0100.00716.54
7.2.290.0070.01716.79
7.2.60.0060.00616.61
7.2.00.0040.01519.11
7.1.200.0060.00615.79
7.1.100.0080.00318.14
7.1.70.0040.00417.14
7.1.60.0110.01420.03
7.1.50.0000.01616.98
7.1.00.0030.07722.42
7.0.200.0240.00314.91
7.0.60.0100.06319.98
7.0.50.0070.07317.88
7.0.40.0000.08720.17
7.0.30.0600.06020.23
7.0.20.0200.05720.07
7.0.10.0000.06720.09
7.0.00.0070.06320.09
5.6.280.0030.06721.12
5.6.210.0100.08320.60
5.6.200.0070.04718.23
5.6.190.0130.08020.41
5.6.180.3170.04320.42
5.6.170.0330.07720.55
5.6.160.0100.05720.61
5.6.150.0070.05718.25
5.6.140.0100.08318.15
5.6.130.0030.04018.14
5.6.120.0070.05021.10
5.6.110.0100.08320.96
5.6.100.0000.08721.00
5.6.90.0200.05321.14
5.6.80.0030.06020.51
5.6.70.3930.03020.43
5.5.350.0200.07320.43
5.5.340.0100.05717.96
5.5.330.0000.09020.19
5.5.320.0370.03720.30
5.5.310.0230.04020.27
5.5.300.0130.07017.95
5.5.290.0130.07017.96
5.5.280.0000.04720.87
5.5.270.0070.08720.86
5.5.260.0070.08720.96
5.5.250.0070.07720.79
5.5.240.0070.06020.16
5.4.450.0230.04019.43
5.4.440.0300.07719.30
5.4.430.0300.07319.63
5.4.420.0270.07319.52
5.4.410.0470.05719.26
5.4.400.0270.05019.09
5.4.390.0270.03319.16
5.4.380.0330.06318.99
5.4.370.0230.04719.15
5.4.360.0270.03718.85
5.4.350.0270.05318.88
5.4.340.0270.07719.15
5.4.320.0270.03319.16
5.4.310.0300.05019.06
5.4.300.0230.04318.94
5.4.290.0230.05019.08
5.4.280.0300.04718.98
5.4.270.0270.03318.85
5.4.260.0270.05719.18
5.4.250.0400.04719.14
5.4.240.0200.04019.13
5.4.230.0300.04719.15
5.4.220.0200.04319.21
5.4.210.0330.06719.21
5.4.200.0330.07018.98
5.4.190.0270.04318.84
5.4.180.0300.06718.97
5.4.170.0370.05018.94
5.4.160.0370.04018.96
5.4.150.0370.06319.14
5.4.140.0370.06016.44
5.4.130.0300.06716.56
5.4.120.0300.04316.57
5.4.110.0300.06716.24
5.4.100.0230.07316.31
5.4.90.0300.06716.45
5.4.80.0470.05316.39

preferences:
56.49 ms | 401 KiB | 5 Q