3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a= []; $b = 'foo'; $c = 'bar'; $a[$b][$c][] = 1; echo "Assign to left-hand side:"; print_it($a,$b,$c); echo "Assign via byref call:"; byref($a[$b][$c]); print_it($a,$b,$c); function byref(&$x) { $x[]= 2; } function print_it($a,$b,$c) { echo "\n"; echo "\n" . json_encode($a); echo "\n" . json_encode($a[$b]); echo "\n" . json_encode($a[$b][$c]); echo "\n\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.0130.00618.43
8.3.50.0030.01316.64
8.3.40.0160.00018.82
8.3.30.0150.00018.67
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.180.0130.00625.92
8.2.170.0080.00818.96
8.2.160.0030.01022.96
8.2.150.0040.00425.66
8.2.140.0070.00024.66
8.2.130.0080.00026.16
8.2.120.0060.00619.35
8.2.110.0030.00622.24
8.2.100.0090.00317.84
8.2.90.0040.00417.75
8.2.80.0060.00318.73
8.2.70.0000.00818.05
8.2.60.0030.00518.22
8.2.50.0000.00818.10
8.2.40.0040.00421.00
8.2.30.0050.00319.38
8.2.20.0040.00418.18
8.2.10.0000.00719.31
8.2.00.0000.00719.31
8.1.280.0110.01125.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00323.61
8.1.230.0040.00821.03
8.1.220.0050.00317.78
8.1.210.0000.00818.77
8.1.200.0110.00017.35
8.1.190.0060.00317.22
8.1.180.0000.00818.10
8.1.170.0000.00818.57
8.1.160.0000.00818.88
8.1.150.0000.00718.89
8.1.140.0040.00418.87
8.1.130.0000.00720.14
8.1.120.0030.00517.46
8.1.110.0000.00817.41
8.1.100.0040.00417.40
8.1.90.0040.00417.38
8.1.80.0020.00717.41
8.1.70.0030.00317.48
8.1.60.0030.00517.44
8.1.50.0040.00417.40
8.1.40.0040.00417.50
8.1.30.0050.00317.61
8.1.20.0050.00317.59
8.1.10.0000.00717.45
8.1.00.0040.00417.40
8.0.300.0070.00018.77
8.0.290.0030.00716.63
8.0.280.0030.00318.41
8.0.270.0040.00416.75
8.0.260.0080.00018.50
8.0.250.0000.00616.97
8.0.240.0030.00316.86
8.0.230.0080.00316.93
8.0.220.0050.00216.92
8.0.210.0000.00716.94
8.0.200.0000.00716.93
8.0.190.0040.00416.96
8.0.180.0080.00016.95
8.0.170.0060.00316.83
8.0.160.0040.00416.91
8.0.150.0030.00516.89
8.0.140.0030.00516.87
8.0.130.0000.00613.30
8.0.120.0050.00316.88
8.0.110.0040.00416.66
8.0.100.0070.00016.95
8.0.90.0000.00816.86
8.0.80.0050.01016.81
8.0.70.0000.00716.87
8.0.60.0050.00316.83
8.0.50.0000.00716.78
8.0.30.0120.00316.76
8.0.20.0120.00316.87
8.0.10.0070.00716.88
8.0.00.0120.00316.92
7.4.330.0000.00515.55
7.4.320.0000.00616.45
7.4.300.0070.00316.59
7.4.290.0030.00616.48
7.4.280.0040.00416.45
7.4.270.0060.00316.52
7.4.260.0030.00313.23
7.4.250.0070.00016.38
7.4.240.0070.00016.52
7.4.230.0050.00316.68
7.4.220.0050.00216.59
7.4.210.0050.00916.47
7.4.200.0040.00416.39
7.4.160.0070.00716.63
7.4.150.0090.00616.71
7.4.140.0080.00616.57
7.4.130.0030.01016.56
7.4.120.0000.01316.50
7.4.110.0070.00716.41
7.4.100.0070.00716.54
7.4.90.0000.01416.62
7.4.80.0060.00916.49
7.4.70.0000.01416.38
7.4.60.0130.00316.50
7.4.50.0030.01016.57
7.4.40.0100.00316.50
7.4.30.0000.01316.35
7.4.20.0100.00316.64
7.4.10.0030.00916.47
7.4.00.0110.00416.55
7.3.330.0040.00416.36
7.3.320.0000.00613.13
7.3.310.0040.00416.28
7.3.300.0000.00716.32
7.3.290.0080.00816.33
7.3.280.0060.01216.32
7.3.270.0070.00716.27
7.3.260.0070.00716.27
7.3.250.0110.00316.37
7.3.240.0050.00916.23
7.3.230.0060.00916.28
7.3.220.0070.00716.17
7.3.210.0070.00716.20
7.3.200.0070.00716.31
7.3.190.0140.00016.23
7.3.180.0030.01016.23
7.3.170.0030.01016.22
7.3.160.0030.01016.24
7.3.150.0080.01416.20
7.3.140.0070.00716.23
7.3.130.0030.01016.23
7.3.120.0070.00616.21
7.3.110.0160.00016.24
7.3.100.0100.00316.17
7.3.90.0130.00016.54
7.3.80.0030.01016.23
7.3.70.0030.00916.28
7.3.60.0030.00916.37
7.3.50.0030.00916.34
7.3.40.0030.01016.41
7.3.30.0060.00616.42
7.3.20.0100.00316.36
7.3.10.0040.01116.36
7.3.00.0090.00616.36

preferences:
62.7 ms | 400 KiB | 5 Q