3v4l.org

run code in 300+ PHP versions simultaneously
--TEST-- Keeping a reference to an object property in an array should not override existing references ?> --FILE-- <?php class Container { /** @var \stdClass|null */ public $referencedProperty; public function __clone() { $this->referencedProperty = clone $this->referencedProperty; } } $references = []; $container = new Container(); $loadFieldByReference = function (& $referencedProperty) use (& $references) { $referencedProperty = new \stdClass(); $references[] = & $referencedProperty; }; $loadFieldByReference($container->referencedProperty); $container->referencedProperty->publicProperty = 123; $clone = clone $container; $clone->referencedProperty->publicProperty = 234; echo $container->referencedProperty->publicProperty, "\n"; echo $clone->referencedProperty->publicProperty, "\n"; echo $container->referencedProperty === $clone->referencedProperty ? "same\n" : "not same\n"; ?> --EXPECT-- 123 234 not same

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.00616.50
8.3.50.0030.01218.31
8.3.40.0040.01118.83
8.3.30.0110.00418.61
8.3.20.0080.00020.21
8.3.10.0000.00821.94
8.3.00.0040.00423.53
8.2.180.0040.01118.55
8.2.170.0120.00922.96
8.2.160.0070.00720.32
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0050.00321.00
8.2.110.0060.00321.10
8.2.100.0060.00617.72
8.2.90.0050.00318.28
8.2.80.0000.00720.36
8.2.70.0050.00318.05
8.2.60.0040.00417.97
8.2.50.0040.00419.38
8.2.40.0000.00821.20
8.2.30.0050.00219.32
8.2.20.0000.00718.09
8.2.10.0020.00518.15
8.2.00.0040.00418.11
8.1.280.0060.01225.92
8.1.270.0070.00320.67
8.1.260.0000.01526.35
8.1.250.0000.00828.09
8.1.240.0000.00822.20
8.1.230.0060.00621.00
8.1.220.0000.00917.74
8.1.210.0050.00318.96
8.1.200.0030.00717.36
8.1.190.0000.00817.22
8.1.180.0060.00319.07
8.1.170.0000.01018.56
8.1.160.0050.00319.09
8.1.150.0030.00518.91
8.1.140.0000.00719.14
8.1.130.0070.00018.79
8.1.120.0040.00417.39
8.1.110.0080.00017.38
8.1.100.0040.00417.52
8.1.90.0070.00017.54
8.1.80.0000.00817.54
8.1.70.0030.00317.46
8.1.60.0040.00417.57
8.1.50.0000.00717.50
8.1.40.0040.00417.61
8.1.30.0070.00317.66
8.1.20.0060.00317.58
8.1.10.0020.00517.67
8.1.00.0070.00017.40
8.0.300.0050.00220.07
8.0.290.0030.00516.75
8.0.280.0030.00518.34
8.0.270.0030.00317.19
8.0.260.0030.00516.71
8.0.250.0070.00016.99
8.0.240.0030.00316.89
8.0.230.0000.00716.91
8.0.220.0070.00016.85
8.0.210.0000.00616.81
8.0.200.0030.00316.94
8.0.190.0040.00416.88
8.0.180.0050.00216.92
8.0.170.0000.00716.82
8.0.160.0040.00416.88
8.0.150.0040.00316.74
8.0.140.0000.00716.76
8.0.130.0000.00513.35
8.0.120.0050.00216.86
8.0.110.0000.00816.76
8.0.100.0040.00416.83
8.0.90.0040.00416.80
8.0.80.0100.00716.96
8.0.70.0000.00716.69
8.0.60.0070.00016.76
8.0.50.0040.00416.91
8.0.30.0120.00717.09
8.0.20.0080.01417.40
8.0.10.0030.00317.01
8.0.00.0070.01116.77
7.4.330.0000.00615.55
7.4.320.0030.00316.63
7.4.300.0030.00316.64
7.4.290.0000.00716.62
7.4.280.0050.00316.57
7.4.270.0000.00716.69
7.4.260.0040.00416.53
7.4.250.0030.00716.50
7.4.240.0000.00716.49
7.4.230.0000.00716.63
7.4.220.0130.00916.59
7.4.210.0110.00316.50
7.4.200.0040.00416.69
7.4.160.0120.00516.50
7.4.150.0150.01317.40
7.4.140.0110.00917.86
7.4.130.0150.00316.63
7.4.120.0110.00716.55
7.4.110.0000.01716.66
7.4.100.0040.01316.71
7.4.90.0090.00916.52
7.4.80.0100.00719.39
7.4.70.0130.00516.32
7.4.60.0150.00016.55
7.4.50.0110.00716.57
7.4.40.0110.00616.52
7.4.30.0130.01016.38
7.4.00.0030.01415.07
7.3.330.0040.00413.24
7.3.320.0030.00313.20
7.3.310.0000.00716.28
7.3.300.0070.00016.43
7.3.290.0030.00316.40
7.3.280.0120.00916.35
7.3.270.0180.00017.40
7.3.260.0070.01016.35
7.3.250.0110.00916.58
7.3.240.0120.00816.43
7.3.230.0150.00616.49
7.3.210.0100.00716.38
7.3.200.0130.00916.65
7.3.190.0030.01416.54
7.3.180.0060.01016.46
7.3.170.0160.00716.52
7.3.160.0120.00416.40
7.2.330.0090.00916.80
7.2.320.0090.00916.69
7.2.310.0030.01316.80
7.2.300.0150.00616.82
7.2.290.0030.01416.43
7.2.60.0060.00616.85
7.2.00.0050.01219.38
7.1.200.0080.00315.72
7.1.120.0040.01118.75
7.1.110.0080.00918.12
7.1.100.0050.01318.16
7.1.90.0100.00618.06
7.1.80.0080.00918.19
7.1.70.0060.00817.24
7.1.60.0160.01335.14
7.1.50.0220.00834.73
7.1.40.0170.01334.49
7.1.30.0130.01634.46
7.1.20.0160.01434.54
7.1.10.0060.00916.66
7.1.00.0030.01216.76

preferences:
58.08 ms | 401 KiB | 5 Q