3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $reference; protected $items = [ 'test', 'test2', 'test3' ]; public function setupReferenceMiddle() { $this->reference = &$this->items[1]; } public function setupReferenceEnd() { $this->reference = &$this->items[2]; } public function output() { return implode(', ', $this->items) . PHP_EOL; } public function modify($value) { $this->reference = $value; } } $test = new Test; echo $test->output(); $test->setupReferenceMiddle(); $test->modify('middle'); echo $test->output(); $test->setupReferenceEnd(); $test->modify('end'); echo $test->output();

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.0150.00318.43
8.3.50.0120.00616.34
8.3.40.0030.01318.59
8.3.30.0120.00318.80
8.3.20.0070.01120.21
8.3.10.0060.00923.74
8.3.00.0040.00419.79
8.2.180.0110.00716.75
8.2.170.0070.00722.96
8.2.160.0100.00320.22
8.2.150.0000.00824.18
8.2.140.0120.00624.66
8.2.130.0050.00226.16
8.2.120.0040.01119.36
8.2.110.0080.00020.52
8.2.100.0090.00317.72
8.2.90.0030.00617.88
8.2.80.0030.00518.03
8.2.70.0030.00617.80
8.2.60.0050.00217.93
8.2.50.0050.00319.36
8.2.40.0100.00020.35
8.2.30.0060.00318.05
8.2.20.0000.00817.82
8.2.10.0040.00418.07
8.2.00.0040.00418.07
8.1.280.0130.00325.92
8.1.270.0040.00420.23
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0030.00622.15
8.1.230.0080.00423.91
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0070.00317.23
8.1.190.0030.00617.25
8.1.180.0000.00818.10
8.1.170.0000.00818.64
8.1.160.0050.00322.08
8.1.150.0000.00718.77
8.1.140.0000.00717.43
8.1.130.0030.00317.91
8.1.120.0050.00317.51
8.1.110.0040.00417.52
8.1.100.0070.00017.39
8.1.90.0040.00417.45
8.1.80.0070.00017.36
8.1.70.0050.00217.47
8.1.60.0060.00317.66
8.1.50.0090.00017.56
8.1.40.0060.00317.53
8.1.30.0040.00417.63
8.1.20.0000.00817.71
8.1.10.0040.00417.43
8.1.00.0060.00317.49
8.0.300.0000.00819.61
8.0.290.0020.00516.75
8.0.280.0030.00318.46
8.0.270.0070.00016.72
8.0.260.0000.00617.20
8.0.250.0040.00416.96
8.0.240.0070.00016.91
8.0.230.0030.00616.94
8.0.220.0070.00016.79
8.0.210.0000.00716.90
8.0.200.0030.00316.88
8.0.190.0000.01016.98
8.0.180.0080.00016.94
8.0.170.0000.00817.00
8.0.160.0030.00616.85
8.0.150.0040.00416.79
8.0.140.0030.00416.93
8.0.130.0050.00413.23
8.0.120.0000.00816.79
8.0.110.0050.00316.83
8.0.100.0000.00716.87
8.0.90.0030.00616.79
8.0.80.0130.00416.96
8.0.70.0050.00216.87
8.0.60.0040.00416.84
8.0.50.0000.00816.80
8.0.30.0090.01016.94
8.0.20.0110.00817.40
8.0.10.0040.00417.09
8.0.00.0070.01016.74
7.4.330.0020.00215.03
7.4.320.0000.00616.41
7.4.300.0000.00616.66
7.4.290.0030.00316.52
7.4.280.0030.00316.54
7.4.270.0030.00316.45
7.4.260.0110.00016.48
7.4.250.0000.00716.59
7.4.240.0030.00316.57
7.4.230.0050.00216.65
7.4.220.0150.00416.64
7.4.210.0110.01116.73
7.4.200.0040.00416.62
7.4.160.0090.00616.43
7.4.150.0120.00617.40
7.4.140.0150.00617.86
7.4.130.0150.00616.50
7.4.120.0110.00616.43
7.4.110.0070.01016.57
7.4.100.0150.01016.47
7.4.90.0110.00716.58
7.4.80.0140.01019.39
7.4.70.0100.01316.55
7.4.60.0090.00616.69
7.4.50.0030.00316.46
7.4.40.0120.01016.61
7.4.30.0120.00616.36
7.4.00.0030.01314.83
7.3.330.0030.00313.37
7.3.320.0050.00013.24
7.3.310.0070.00016.25
7.3.300.0040.00416.20
7.3.290.0090.00616.40
7.3.280.0110.00516.39
7.3.270.0060.01217.40
7.3.260.0070.01116.64
7.3.250.0070.01016.39
7.3.240.0140.01016.50
7.3.230.0110.00716.48
7.3.210.0070.01016.34
7.3.200.0060.01319.39
7.3.190.0170.00416.31
7.3.180.0160.00616.43
7.3.170.0030.01316.29
7.3.160.0060.00916.64
7.2.330.0040.01716.49
7.2.320.0130.00516.69
7.2.310.0100.00716.64
7.2.300.0070.01416.46
7.2.290.0150.00916.59
7.2.00.0120.00419.66
7.1.200.0000.00915.49
7.1.100.0080.00817.96
7.1.70.0030.00617.20
7.1.60.0100.01319.86
7.1.50.0110.01516.86
7.1.00.0030.07722.36
7.0.200.1060.00314.40
7.0.60.0030.08019.84
7.0.50.0070.04017.87
7.0.40.0170.07020.11
7.0.30.0270.04020.26
7.0.20.0200.07020.23
7.0.10.0030.09020.25
7.0.00.0070.07020.25
5.6.280.0000.07720.92
5.6.210.0100.07320.72
5.6.200.0070.08018.18
5.6.190.0100.05020.63
5.6.180.0630.05720.41
5.6.170.0200.04720.54
5.6.160.0070.08720.54
5.6.150.0070.08018.14
5.6.140.0070.07018.30
5.6.130.0070.04018.11
5.6.120.0030.06021.00
5.6.110.0070.06721.03
5.6.100.0070.07020.99
5.6.90.0100.08021.04
5.6.80.0000.06720.32
5.5.350.0170.04720.35
5.5.340.0070.04018.07
5.5.330.0100.07720.40
5.5.320.0330.07720.23
5.5.310.0470.06020.34
5.5.300.0070.06017.92
5.5.290.0070.05717.99
5.5.280.0100.08020.86
5.5.270.0300.06320.85
5.5.260.0030.08720.88
5.5.250.0070.08320.55
5.5.240.0070.06720.13
5.4.450.0530.06019.56
5.4.440.0800.05719.43
5.4.430.0130.05019.38
5.4.420.0070.05319.63
5.4.410.0030.05719.45
5.4.400.0070.05019.08
5.4.390.0170.04018.98
5.4.380.0030.05719.07
5.4.370.0000.05719.16
5.4.360.0100.04719.24
5.4.350.0100.05019.24
5.4.340.0200.04019.11
5.4.320.0130.04719.12
5.4.310.0070.05319.13
5.4.300.0100.04719.11
5.4.290.0070.05319.13
5.4.280.0070.05019.21
5.4.270.0070.05319.24
5.4.260.0070.05319.03
5.4.250.0070.05019.09
5.4.240.0000.06019.12
5.4.230.0000.05719.24
5.4.220.0130.04719.25
5.4.210.0070.05319.20
5.4.200.0070.05016.88
5.4.190.0100.05019.00
5.4.180.0100.05019.07
5.4.170.0030.05719.04
5.4.160.0000.06019.05
5.4.150.0070.05019.06
5.4.140.0030.05316.68
5.4.130.0070.04716.33
5.4.120.0270.06016.66
5.4.110.0130.04316.40
5.4.100.0000.06016.25
5.4.90.0030.05316.48
5.4.80.0100.04316.23
5.4.70.0100.05016.46
5.4.60.0070.05316.63
5.4.50.0170.05316.59
5.4.40.0070.05016.39
5.4.30.0100.04316.59
5.4.20.0070.05016.22
5.4.10.0070.05016.43
5.4.00.0100.04316.08
5.3.290.0070.05314.72
5.3.280.0100.04714.64
5.3.270.0100.05014.68
5.3.260.0000.06014.61
5.3.250.0070.05014.51
5.3.240.0130.04314.77
5.3.230.0000.05714.64
5.3.220.0000.06014.46
5.3.210.0070.05314.49
5.3.200.0100.04714.59
5.3.190.0030.05714.57
5.3.180.0100.05014.61
5.3.170.0130.04714.52
5.3.160.0000.06014.71
5.3.150.0000.06014.56
5.3.140.0030.05314.56
5.3.130.0130.05014.40
5.3.120.0100.06714.45
5.3.110.0130.04714.57
5.3.100.0030.05313.94
5.3.90.0100.04713.93
5.3.80.0100.04714.02
5.3.70.0070.05313.93
5.3.60.0100.04713.98
5.3.50.0100.05713.88
5.3.40.0100.04713.87
5.3.30.0000.05714.05
5.3.20.0030.05313.75
5.3.10.0100.04313.77
5.3.00.0030.05013.63
5.2.170.0030.04311.14
5.2.160.0000.04311.30
5.2.150.0100.03711.29
5.2.140.0030.04311.13
5.2.130.0100.03311.00
5.2.120.0100.04311.00
5.2.110.0030.04011.24
5.2.100.0030.04011.10
5.2.90.0100.03310.95
5.2.80.0070.04011.00
5.2.70.0030.04311.00
5.2.60.0000.04710.99
5.2.50.0030.04011.00
5.2.40.0070.03710.85
5.2.30.0070.05311.09
5.2.20.0000.04310.86
5.2.10.0100.03311.02
5.2.00.0000.04310.69
5.1.60.0000.0379.91
5.1.50.0070.0339.98
5.1.40.0070.04010.06
5.1.30.0130.02710.24
5.1.20.0070.04310.41
5.1.10.0100.04310.11
5.1.00.0000.04010.06
5.0.50.0030.0278.42
5.0.40.0070.0238.32
5.0.30.0070.0378.27
5.0.20.0000.0308.23
5.0.10.0070.0408.30
5.0.00.0070.0408.07
4.4.90.0000.0235.78
4.4.80.0000.0235.77
4.4.70.0000.0235.74
4.4.60.0070.0235.92
4.4.50.0000.0275.91
4.4.40.0000.0405.89
4.4.30.0070.0175.74
4.4.20.0030.0235.93
4.4.10.0000.0275.97
4.4.00.0000.0375.92
4.3.110.0000.0275.77
4.3.100.0000.0235.78
4.3.90.0030.0205.73
4.3.80.0030.0335.74
4.3.70.0000.0235.72
4.3.60.0070.0175.77
4.3.50.0030.0235.67
4.3.40.0030.0375.61
4.3.30.0000.0234.41
4.3.20.0000.0234.43
4.3.10.0000.0234.43
4.3.00.0000.0236.98

preferences:
60.83 ms | 400 KiB | 5 Q