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); if ($prices[0] == 100) { echo "Pass-by-reference!"; } else { echo "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.60.0090.00916.75
8.3.50.0100.01121.06
8.3.40.0110.00419.09
8.3.30.0110.00418.69
8.3.20.0040.00420.29
8.3.10.0000.00721.75
8.3.00.0060.00319.69
8.2.180.0110.00416.73
8.2.170.0090.01222.96
8.2.160.0070.00720.57
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0050.00317.75
8.2.110.0030.00620.44
8.2.100.0040.00817.84
8.2.90.0040.00419.17
8.2.80.0050.00317.97
8.2.70.0040.00417.63
8.2.60.0040.00418.05
8.2.50.0000.00918.07
8.2.40.0040.00421.09
8.2.30.0080.00019.83
8.2.20.0080.00017.77
8.2.10.0050.00218.06
8.2.00.0040.00418.06
8.1.280.0070.00725.92
8.1.270.0050.00320.42
8.1.260.0000.00826.35
8.1.250.0050.00228.09
8.1.240.0060.00323.96
8.1.230.0090.00320.78
8.1.220.0030.00617.76
8.1.210.0030.00518.77
8.1.200.0030.00717.35
8.1.190.0080.00017.25
8.1.180.0040.00418.10
8.1.170.0080.00018.46
8.1.160.0000.00721.89
8.1.150.0000.00718.85
8.1.140.0060.00317.50
8.1.130.0000.00717.71
8.1.120.0000.00717.51
8.1.110.0030.00517.36
8.1.100.0030.00517.50
8.1.90.0040.00417.40
8.1.80.0040.00417.49
8.1.70.0000.00717.49
8.1.60.0040.00417.59
8.1.50.0040.00417.55
8.1.40.0080.00017.38
8.1.30.0100.00017.59
8.1.20.0000.00717.65
8.1.10.0000.00717.57
8.1.00.0000.00817.47
8.0.300.0030.00518.77
8.0.290.0000.00816.75
8.0.280.0000.00718.36
8.0.270.0030.00517.18
8.0.260.0030.00317.18
8.0.250.0070.00016.92
8.0.240.0030.00316.82
8.0.230.0070.00016.98
8.0.220.0040.00416.96
8.0.210.0040.00416.93
8.0.200.0040.00416.94
8.0.190.0030.00616.92
8.0.180.0050.00216.91
8.0.170.0030.00616.91
8.0.160.0000.00716.85
8.0.150.0000.00716.84
8.0.140.0050.00216.89
8.0.130.0050.00013.38
8.0.120.0030.00516.92
8.0.110.0040.00416.84
8.0.100.0020.00516.78
8.0.90.0000.00716.94
8.0.80.0120.00416.87
8.0.70.0040.00417.00
8.0.60.0040.00416.95
8.0.50.0040.00416.94
8.0.30.0030.01417.06
8.0.20.0120.01017.40
8.0.10.0040.00416.95
8.0.00.0140.00416.80
7.4.330.0030.00315.08
7.4.320.0000.00716.61
7.4.300.0060.00016.49
7.4.290.0000.00716.52
7.4.280.0000.00716.59
7.4.270.0000.00716.43
7.4.260.0030.00316.39
7.4.250.0050.00316.55
7.4.240.0030.00316.50
7.4.230.0070.00016.64
7.4.220.0150.00416.70
7.4.210.0120.00916.64
7.4.200.0000.00816.61
7.4.160.0120.01216.76
7.4.150.0030.01317.40
7.4.140.0180.00417.86
7.4.130.0060.01116.47
7.4.120.0070.01016.42
7.4.110.0120.00616.71
7.4.100.0080.01516.51
7.4.90.0120.00616.52
7.4.80.0110.01219.39
7.4.70.0080.00816.54
7.4.60.0070.01016.48
7.4.50.0000.00716.55
7.4.40.0110.00816.64
7.4.30.0140.00916.41
7.4.00.0070.01114.83
7.3.330.0030.00313.38
7.3.320.0050.00013.43
7.3.310.0000.00716.43
7.3.300.0060.00016.43
7.3.290.0060.00816.44
7.3.280.0130.00616.41
7.3.270.0100.00717.40
7.3.260.0070.01016.34
7.3.250.0080.00916.49
7.3.240.0120.00916.66
7.3.230.0100.01316.49
7.3.210.0070.01116.38
7.3.200.0060.01316.35
7.3.190.0140.00316.27
7.3.180.0120.00616.46
7.3.170.0090.00916.48
7.3.160.0130.00316.53
7.3.10.0060.01016.53
7.3.00.0070.00716.55
7.2.330.0130.01016.79
7.2.320.0170.00616.76
7.2.310.0120.00816.86
7.2.300.0000.01716.83
7.2.290.0110.01416.84
7.2.130.0110.01016.79
7.2.120.0120.00716.85
7.2.110.0080.00816.64
7.2.100.0110.00216.68
7.2.90.0060.00816.85
7.2.80.0090.00516.74
7.2.70.0090.00916.77
7.2.60.0070.00916.63
7.2.50.0130.00716.90
7.2.40.0090.00516.66
7.2.30.0050.01116.80
7.2.20.0070.01316.83
7.2.10.0090.00716.95
7.2.00.0070.00917.76
7.1.250.0070.00715.75
7.1.200.0050.00515.79
7.1.100.0040.00718.09
7.1.70.0070.00017.28
7.1.60.0040.02220.03
7.1.50.0040.01917.00
7.1.00.0130.06722.40
7.0.200.0120.00314.73
7.0.60.0200.07019.93
7.0.50.0100.07717.92
7.0.40.0030.05320.05
7.0.30.0230.05720.34
7.0.20.0270.03720.05
7.0.10.0100.08720.26
7.0.00.0070.04020.25
5.6.280.0030.06020.78
5.6.210.0100.08020.55
5.6.200.0070.04318.20
5.6.190.0130.07020.48
5.6.180.0430.06020.77
5.6.170.0200.04720.50
5.6.160.0130.07720.39
5.6.150.0170.04018.29
5.6.140.0000.06718.21
5.6.130.0030.08318.16
5.6.120.0100.04720.90
5.6.110.0070.08021.03
5.6.100.0070.07020.98
5.6.90.0070.08721.07
5.6.80.0030.07320.38
5.6.70.4500.04720.40
5.5.350.0200.07320.41
5.5.340.0130.07317.93
5.5.330.0170.04720.43
5.5.320.0270.06020.32
5.5.310.0400.03320.30
5.5.300.0130.04718.03
5.5.290.0030.08318.09
5.5.280.0100.08320.77
5.5.270.0100.06020.78
5.5.260.0070.08320.79
5.5.250.0030.07320.67
5.5.240.0230.06720.19
5.4.450.0330.06319.48
5.4.440.0270.05719.61
5.4.430.0370.04719.46
5.4.420.0270.05719.45
5.4.410.0300.05019.21
5.4.400.0170.05319.31
5.4.390.0170.04719.15
5.4.380.0100.05019.06
5.4.370.0400.06319.32
5.4.360.0470.04718.88
5.4.350.0400.05019.15
5.4.340.0370.05719.28
5.4.320.0370.05318.88
5.4.310.0500.05718.98
5.4.300.0400.04719.14
5.4.290.0330.05719.15
5.4.280.0300.06319.30
5.4.270.0300.05319.15
5.4.260.0400.04719.05
5.4.250.0400.05019.26
5.4.240.0530.04719.30
5.4.230.0270.06319.14
5.4.220.0330.05719.00
5.4.210.0330.05719.14
5.4.200.0500.04019.14
5.4.190.0330.05318.82
5.4.180.0370.05319.35
5.4.170.0400.05019.35
5.4.160.0370.05019.14
5.4.150.0370.05319.14
5.4.140.0330.05016.33
5.4.130.0300.05316.62
5.4.120.0330.05316.32
5.4.110.0370.05316.68
5.4.100.0430.04716.51
5.4.90.0370.04716.50
5.4.80.0400.04316.48
5.4.70.0070.05316.58
5.4.60.0170.04316.33
5.4.50.0000.03716.16
5.4.40.0230.05016.24
5.4.30.0130.04016.48
5.4.20.0300.06316.34

preferences:
60.72 ms | 401 KiB | 5 Q