3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getObject(int $index): \stdClass { $obj = new \stdClass(); $obj->index = $index; return $obj; } $objectStorage = new \SplObjectStorage(); for ($i = 0; $i < 10; $i++) { $objectStorage->attach(getObject($i)); } echo 'Count before detach: ' . $objectStorage->count() . "\n"; foreach ($objectStorage as $object) { if ($objectStorage->contains($object)) { $objectStorage->detach($object); } } echo 'Expected count after detach: 0' . "\n"; echo 'Actual count after detach: ' . $objectStorage->count();

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.140.0040.01116.56
8.3.130.0160.00318.50
8.3.120.0100.00020.70
8.3.110.0030.00620.94
8.3.100.0130.00616.75
8.3.90.0130.00626.77
8.3.80.0090.00016.50
8.3.70.0100.00716.58
8.3.60.0080.00816.48
8.3.50.0070.01419.85
8.3.40.0030.01321.62
8.3.30.0110.00718.63
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0070.00026.16
8.2.260.0060.00316.60
8.2.250.0040.00418.23
8.2.240.0060.00317.35
8.2.230.0090.00022.58
8.2.220.0060.00324.06
8.2.210.0080.00026.77
8.2.200.0060.00316.88
8.2.190.0170.00316.58
8.2.180.0140.00025.92
8.2.170.0070.00718.88
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0020.00524.66
8.2.130.0040.00426.16
8.2.120.0050.00226.16
8.2.110.0060.00320.49
8.2.100.0040.00817.91
8.2.90.0030.00617.50
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0050.00217.63
8.2.50.0070.00317.98
8.2.40.0050.00217.72
8.2.30.0070.00017.77
8.2.20.0040.00420.48
8.2.10.0000.00817.76
8.2.00.0000.00719.37
8.1.300.0060.00320.20
8.1.290.0000.01018.88
8.1.280.0040.01425.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0080.00022.14
8.1.230.0070.00420.49
8.1.220.0050.00317.76
8.1.210.0080.00018.77
8.1.200.0100.00017.35
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0020.00517.62
8.1.160.0040.00420.34
8.1.150.0030.00618.57
8.1.140.0090.00317.46
8.1.130.0030.00319.01
8.1.120.0000.00717.48
8.1.110.0000.00917.46
8.1.100.0040.00417.31
8.1.90.0000.00717.34
8.1.80.0030.00517.47
8.1.70.0060.00317.48
8.1.60.0020.00517.58
8.1.50.0030.00617.43
8.1.40.0040.00417.48
8.1.30.0030.00517.70
8.1.20.0040.00417.65
8.1.10.0000.01017.41
8.1.00.0200.00317.45
8.0.300.0060.00319.66
8.0.290.0030.00616.63
8.0.280.0000.00718.57
8.0.270.0030.00316.83
8.0.260.0080.00018.37
8.0.250.0000.00717.02
8.0.240.0000.00716.86
8.0.230.0030.00316.94
8.0.220.0000.00816.89
8.0.210.0070.00016.96
8.0.200.0000.00817.00
8.0.190.0030.00516.92
8.0.180.0040.00416.89
8.0.170.0040.00416.94
8.0.160.0040.00416.89
8.0.150.0040.00416.91
8.0.140.0180.00016.71
8.0.130.0140.00516.68
8.0.120.0130.00616.80
8.0.110.0180.00016.82
8.0.100.0180.00016.79
8.0.90.0160.00316.70
8.0.80.0150.00416.87
8.0.70.0190.00016.70
8.0.60.0130.00516.85
8.0.50.0160.00316.71
8.0.30.0130.00516.75
8.0.20.0160.00716.88
8.0.10.0060.01216.89
8.0.00.0050.00517.04
7.4.330.0050.00015.55
7.4.320.0070.00016.47
7.4.300.0060.00016.62
7.4.290.0040.00416.54
7.4.280.0070.00016.62
7.4.270.0190.00316.46
7.4.260.0140.00716.43
7.4.250.0180.00416.38
7.4.240.0130.00916.50
7.4.230.0200.00016.42
7.4.220.0060.01316.46
7.4.210.0130.00716.48
7.4.200.0150.00316.39
7.4.190.0060.01316.56
7.4.180.0150.00316.61
7.4.160.0140.00316.46
7.4.150.0100.00716.49
7.4.140.0190.00016.41
7.4.130.0090.00916.44
7.4.120.0090.00916.52
7.4.110.0100.00716.43
7.4.100.0130.00516.42
7.4.90.0160.00316.50
7.4.80.0160.00316.46
7.4.70.0090.00316.23
7.4.60.0050.00816.08
7.4.50.0120.00016.00
7.4.40.0090.00316.11
7.4.30.0060.00616.23
7.4.20.0080.00416.16
7.4.10.0130.00616.51
7.4.00.0160.00316.50
7.3.330.0160.00316.18
7.3.320.0120.00916.34
7.3.310.0110.00716.14
7.3.300.0140.00516.32
7.3.290.0180.00015.96
7.3.280.0120.00316.03
7.3.270.0090.00516.22
7.3.260.0100.00616.11
7.3.250.0120.00015.86
7.3.240.0060.00616.00
7.3.230.0070.00516.34
7.3.220.0070.00616.23
7.3.210.0090.00416.07
7.3.200.0020.00716.23
7.3.190.0060.00716.41
7.3.180.0080.00416.32
7.3.170.0080.00416.18
7.3.160.0040.00716.11
7.3.150.0120.00016.12
7.3.140.0110.00016.30
7.3.130.0060.00616.07

preferences:
43.99 ms | 403 KiB | 5 Q