3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Reference { private static $DATA = []; private $index = 0; public function __construct($value) { // cannot create a reference of a reference if ($value instanceof self) { $this->index = $value->index; } else { $this->index = count(self::$DATA); self::$DATA[$this->index] = $value; } } public function get() { return self::$DATA[$this->index]; } public function set($value) { self::$DATA[$this->index] = $value; } } $orig = [1]; // $ref =& $orig[0]; $orig[0] = new Reference($orig[0]); $ref = clone $orig[0]; $copy = $orig; $copy[0] = clone $orig[0]; // creating a copy of what was in $orig[0] // $orig[0] = 10; $orig[0]->set(10); // var_dump($copy[0]); var_dump($copy[0]->get());

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.4.120.0140.00622.00
8.4.110.0090.01020.73
8.4.100.0140.01117.76
8.4.90.0120.00917.94
8.4.80.0040.00417.79
8.4.70.0070.00317.69
8.4.60.0050.00422.53
8.4.50.0110.00918.97
8.4.40.0130.00719.38
8.4.30.0100.01017.46
8.4.20.0100.01017.67
8.4.10.0110.00017.59
8.3.250.0120.00618.81
8.3.240.0030.00616.59
8.3.230.0130.00616.95
8.3.220.0050.00417.39
8.3.210.0080.00716.79
8.3.200.0100.00919.03
8.3.190.0100.01017.24
8.3.180.0020.00519.04
8.3.170.0130.00617.21
8.3.160.0030.01418.42
8.3.150.0110.00417.22
8.3.140.0040.00416.48
8.3.130.0000.00818.46
8.3.120.0060.00320.70
8.3.110.0040.00420.94
8.3.100.0000.00824.06
8.3.90.0030.00526.77
8.3.80.0060.00317.97
8.3.70.0040.01116.75
8.3.60.0140.00416.88
8.3.50.0130.00822.05
8.3.40.0080.00818.80
8.3.30.0150.00018.85
8.3.20.0070.00019.29
8.3.10.0050.00221.76
8.3.00.0000.00919.02
8.2.290.0120.00820.59
8.2.280.0090.00916.60
8.2.270.0140.00316.93
8.2.260.0080.00019.00
8.2.250.0130.00016.82
8.2.240.0000.00817.14
8.2.230.0160.00022.58
8.2.220.0030.00637.54
8.2.210.0070.00026.77
8.2.200.0050.00518.54
8.2.190.0130.00320.19
8.2.180.0040.01518.41
8.2.170.0000.01422.96
8.2.160.0100.00622.02
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0030.01018.04
8.2.120.0040.00426.35
8.2.110.0090.00021.07
8.2.100.0030.00719.35
8.2.90.0000.00817.97
8.2.80.0000.00820.43
8.2.70.0030.00617.63
8.2.60.0050.00317.93
8.2.50.0000.00918.09
8.2.40.0000.00922.15
8.2.30.0040.00419.39
8.2.20.0040.00417.68
8.2.10.0050.00318.19
8.2.00.0030.00618.19
8.1.330.0140.00616.86
8.1.320.0120.00916.11
8.1.310.0090.00616.63
8.1.300.0060.00316.09
8.1.290.0030.00730.84
8.1.280.0170.00325.92
8.1.270.0000.00723.62
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0040.00419.30
8.1.230.0000.01121.01
8.1.220.0030.00517.74
8.1.210.0000.00818.85
8.1.200.0000.00917.48
8.1.190.0080.00017.35
8.1.180.0040.00418.10
8.1.170.0040.00418.46
8.1.160.0000.00720.83
8.1.150.0040.00418.92
8.1.140.0040.00419.49
8.1.130.0100.00017.70
8.1.120.0040.00417.48
8.1.110.0050.00217.49
8.1.100.0070.00017.45
8.1.90.0060.00317.51
8.1.80.0030.00517.53
8.1.70.0000.00717.39
8.1.60.0040.00417.58
8.1.50.0030.00617.53
8.1.40.0040.00417.48
8.1.30.0060.00317.70
8.1.20.0030.00517.64
8.1.10.0070.00017.54
8.1.00.0030.00617.51
8.0.300.0070.00020.20
8.0.290.0070.00016.58
8.0.280.0030.00318.26
8.0.270.0030.00317.18
8.0.260.0030.00317.19
8.0.250.0030.00316.87
8.0.240.0000.00816.79
8.0.230.0030.00316.93
8.0.220.0040.00416.88
8.0.210.0000.00716.81
8.0.200.0000.00716.78
8.0.190.0030.00516.94
8.0.180.0040.00416.95
8.0.170.0000.00716.94
8.0.160.0080.00016.88
8.0.150.0030.00516.75
8.0.140.0070.00016.86
8.0.130.0080.00013.25
8.0.120.0000.00816.85
8.0.110.0000.00716.93
8.0.100.0000.00816.84
8.0.90.0030.00316.79
8.0.80.0140.00716.89
8.0.70.0050.00216.69
8.0.60.0000.00716.68
8.0.50.0000.00716.75
8.0.30.0140.00317.12
8.0.20.0130.00817.40
8.0.10.0060.00316.83
8.0.00.0130.00316.64
7.4.330.0000.00515.08
7.4.320.0050.00216.57
7.4.300.0000.01016.28
7.4.290.0070.00016.46
7.4.280.0080.00316.45
7.4.270.0030.00316.54
7.4.260.0080.00016.63
7.4.250.0040.00416.39
7.4.240.0070.00016.65
7.4.230.0050.00316.63
7.4.220.0030.01316.52
7.4.210.0070.01016.59
7.4.200.0030.00516.61
7.4.160.0110.00516.50
7.4.150.0120.00617.40
7.4.140.0070.01117.86
7.4.130.0090.00816.50
7.4.120.0080.01116.51
7.4.110.0070.01116.39
7.4.100.0070.01016.52
7.4.90.0120.00616.41
7.4.80.0160.00619.39
7.4.70.0120.00616.76
7.4.60.0090.00916.38
7.4.50.0110.00716.47
7.4.40.0080.00816.67
7.4.30.0090.00616.50
7.4.00.0060.01014.70
7.3.330.0020.00213.38
7.3.320.0050.00013.32
7.3.310.0030.00316.39
7.3.300.0030.00316.33
7.3.290.0000.00616.36
7.3.280.0090.00816.38
7.3.270.0120.00617.40
7.3.260.0130.00416.48
7.3.250.0110.00716.37
7.3.240.0110.01116.39
7.3.230.0090.00916.39
7.3.210.0000.01616.50
7.3.200.0060.01119.39
7.3.190.0110.00916.67
7.3.180.0090.00916.54
7.3.170.0070.01116.41
7.3.160.0080.00816.43
7.2.330.0120.01216.76
7.2.320.0070.01316.50
7.2.310.0130.00316.44
7.2.300.0070.01316.36
7.2.290.0090.01216.59
7.2.60.0030.00616.91
7.2.00.0000.01419.18
7.1.200.0090.00615.93
7.1.100.0070.00718.28
7.1.70.0040.00417.25
7.1.60.0030.02119.85
7.1.00.0070.07022.33
7.0.200.0120.00615.00
7.0.60.0070.06320.14
7.0.50.0100.06020.47
7.0.40.0530.05020.34
7.0.30.0530.06720.34
7.0.20.0670.05720.24
7.0.10.0630.04720.30
7.0.00.0500.05320.32
5.6.280.0000.07720.93
5.6.210.0170.05320.70
5.6.200.0570.04721.07
5.6.190.0500.05021.04
5.6.180.0470.05020.96
5.6.170.0530.05721.21
5.6.160.0570.05321.18
5.6.150.0400.05720.97
5.6.140.0070.06021.08
5.6.130.0100.06021.06
5.6.120.0430.06320.96
5.6.110.0500.05021.01
5.6.100.0430.05021.04
5.6.90.0100.06321.04
5.6.80.0400.04720.41
5.6.70.0230.05320.48
5.6.60.0400.04320.58
5.6.50.0130.05320.45
5.6.40.0270.05320.41
5.6.30.0100.06320.54
5.6.20.0200.05320.35
5.6.10.0270.05020.32
5.6.00.0170.05720.36
5.5.350.0200.05720.43
5.5.340.0470.05720.72
5.5.330.0470.04720.72
5.5.320.0430.05321.05
5.5.310.0530.05320.87
5.5.300.0370.05720.77
5.5.290.0100.06720.81
5.5.280.0270.06020.80
5.5.270.0470.05720.86
5.5.260.0400.06020.91
5.5.250.0200.06320.69
5.5.240.0330.05320.34
5.5.230.0400.04020.41
5.5.220.0230.04320.34
5.5.210.0130.05320.25
5.5.200.0100.05720.21
5.5.190.0130.06020.12
5.5.180.0170.06020.10
5.5.160.0100.06020.12
5.5.150.0200.04720.06
5.5.140.0230.06020.21
5.5.130.0100.06020.21
5.5.120.0100.06020.19
5.5.110.0270.04720.05
5.5.100.0170.05320.18
5.5.90.0170.05020.14
5.5.80.0100.06020.16
5.5.70.0300.05720.13
5.5.60.0100.05320.17
5.5.50.0430.04020.00
5.5.40.0300.06020.07
5.5.30.0370.05720.15
5.5.20.0470.04320.18
5.5.10.0430.05019.97
5.5.00.0270.05720.09

preferences:
60.92 ms | 403 KiB | 5 Q