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 (clone $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.0110.00720.68
8.3.130.0120.00418.60
8.3.120.0130.00618.93
8.3.110.0110.00820.94
8.3.100.0060.00316.53
8.3.90.0080.00026.77
8.3.80.0090.00016.50
8.3.70.0100.00716.63
8.3.60.0110.00416.63
8.3.50.0090.00619.99
8.3.40.0030.01621.90
8.3.30.0110.00718.62
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0050.00326.16
8.2.250.0080.00016.66
8.2.240.0060.00318.58
8.2.230.0060.00322.58
8.2.220.0040.00424.06
8.2.210.0000.00826.77
8.2.200.0030.00616.50
8.2.190.0150.00616.58
8.2.180.0060.00925.92
8.2.170.0120.00918.91
8.2.160.0070.01322.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0030.00626.35
8.2.110.0060.00322.14
8.2.100.0040.00817.85
8.2.90.0080.00018.28
8.2.80.0000.00817.97
8.2.70.0000.00817.63
8.2.60.0000.00817.50
8.2.50.0030.00717.98
8.2.40.0040.00417.72
8.2.30.0050.00217.61
8.2.20.0000.00820.35
8.2.10.0080.00017.82
8.2.00.0000.00719.23
8.1.300.0130.00720.06
8.1.290.0030.00630.84
8.1.280.0110.00725.92
8.1.270.0000.00823.99
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0030.00523.97
8.1.230.0080.00320.89
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0080.00017.53
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0000.00717.62
8.1.160.0040.00420.19
8.1.150.0030.00718.71
8.1.140.0000.00917.43
8.1.130.0000.00718.96
8.1.120.0070.00017.50
8.1.110.0080.00017.46
8.1.100.0040.00417.46
8.1.90.0000.00817.41
8.1.80.0050.00317.36
8.1.70.0000.00717.43
8.1.60.0000.00817.64
8.1.50.0000.00917.60
8.1.40.0030.00517.51
8.1.30.0000.00917.66
8.1.20.0050.00317.73
8.1.10.0000.01217.56
8.1.00.0130.00917.47
8.0.300.0000.00720.07
8.0.290.0040.00416.75
8.0.280.0070.00018.45
8.0.270.0050.00216.83
8.0.260.0070.00018.39
8.0.250.0000.00817.00
8.0.240.0040.00416.83
8.0.230.0000.00816.81
8.0.220.0030.00316.91
8.0.210.0020.00516.96
8.0.200.0000.00716.88
8.0.190.0040.00416.81
8.0.180.0040.00416.79
8.0.170.0050.00516.81
8.0.160.0000.00816.77
8.0.150.0000.00716.85
8.0.140.0150.00316.70
8.0.130.0130.00616.71
8.0.120.0190.00016.74
8.0.110.0180.00016.96
8.0.100.0150.00416.73
8.0.90.0150.00416.67
8.0.80.0150.00416.80
8.0.70.0150.00516.73
8.0.60.0130.00516.77
8.0.50.0180.00016.89
8.0.30.0120.00716.87
8.0.20.0180.00516.82
8.0.10.0140.00516.98
8.0.00.0050.00517.07
7.4.330.0000.00515.55
7.4.320.0030.00316.48
7.4.300.0030.00316.38
7.4.290.0000.00716.45
7.4.280.0040.00416.46
7.4.270.0100.01016.49
7.4.260.0150.00616.45
7.4.250.0220.00016.45
7.4.240.0220.00016.49
7.4.230.0120.00816.48
7.4.220.0160.00416.59
7.4.210.0050.01416.38
7.4.200.0120.00716.47
7.4.190.0120.00816.59
7.4.180.0100.00716.51
7.4.160.0130.00416.52
7.4.150.0110.00716.47
7.4.140.0140.00516.53
7.4.130.0120.00616.32
7.4.120.0130.00416.49
7.4.110.0140.00516.43
7.4.100.0180.00016.48
7.4.90.0180.00016.43
7.4.80.0140.00316.52
7.4.70.0090.00316.16
7.4.60.0060.00615.93
7.4.50.0090.00316.03
7.4.40.0090.00416.09
7.4.30.0110.00016.25
7.4.20.0100.00316.03
7.4.10.0180.00316.34
7.4.00.0100.01016.48
7.3.330.0140.00516.40
7.3.320.0140.00716.27
7.3.310.0170.00216.30
7.3.300.0160.00316.36
7.3.290.0150.00416.22
7.3.280.0080.00616.19
7.3.270.0070.00716.21
7.3.260.0140.00416.14
7.3.250.0060.00616.07
7.3.240.0090.00316.16
7.3.230.0050.00516.38
7.3.220.0050.00816.26
7.3.210.0060.00615.94
7.3.200.0120.00016.27
7.3.190.0100.00316.32
7.3.180.0060.00616.31
7.3.170.0060.00616.12
7.3.160.0060.00616.25
7.3.150.0090.00316.08
7.3.140.0090.00216.11
7.3.130.0090.00315.95

preferences:
51.28 ms | 403 KiB | 5 Q