3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $val; public function __construct($val) { $this->val = $val; } } $storage = new SplObjectStorage; $expected = 10; // 10 iterations is expected, as storage has 10 objects attached for($i = 1; $i <= $expected; $i++) { $storage->attach(new A($i)); } $iterations = 0; $storage->rewind(); while ($storage->valid()) { $iterations++; $object = $storage->current(); echo 'Iteration #' . $iterations . ' with object A(' . $object->val . ')'; $storage->next(); if($iterations === 2 || $iterations === 8) { $storage->detach($object); echo ' - deleted Object A(' . $object->val . ') '; } echo PHP_EOL; } echo 'Number of iterations: ' . $iterations . PHP_EOL;

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.0110.01116.35
8.3.50.0140.00722.07
8.3.40.0150.00718.81
8.3.30.0120.00319.09
8.3.20.0080.00020.38
8.3.10.0090.00023.70
8.3.00.0000.01019.38
8.2.180.0040.01218.41
8.2.170.0070.01522.96
8.2.160.0110.00420.39
8.2.150.0060.00324.18
8.2.140.0120.00324.66
8.2.130.0030.00526.16
8.2.120.0000.00822.25
8.2.110.0100.00020.92
8.2.100.0040.00817.71
8.2.90.0080.00019.18
8.2.80.0040.00417.97
8.2.70.0040.00417.59
8.2.60.0000.00818.04
8.2.50.0030.00618.07
8.2.40.0030.00617.97
8.2.30.0030.00518.13
8.2.20.0050.00317.64
8.2.10.0000.00817.75
8.2.00.0030.00617.82
8.1.280.0110.00425.92
8.1.270.0050.00523.96
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0060.00321.27
8.1.230.0090.00317.45
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0090.00017.35
8.1.190.0050.00317.36
8.1.180.0030.00618.10
8.1.170.0000.00818.57
8.1.160.0040.00422.08
8.1.150.0030.00518.64
8.1.140.0000.00817.38
8.1.130.0000.00717.75
8.1.120.0040.00417.44
8.1.110.0000.00717.50
8.1.100.0000.00817.51
8.1.90.0000.00817.50
8.1.80.0030.00617.46
8.1.70.0030.00317.36
8.1.60.0080.00017.59
8.1.50.0040.00417.52
8.1.40.0040.00417.52
8.1.30.0030.00517.66
8.1.20.0030.00617.50
8.1.10.0040.00417.62
8.1.00.0050.00317.41
8.0.300.0040.00418.77
8.0.290.0060.00316.63
8.0.280.0040.00418.46
8.0.270.0040.00417.25
8.0.260.0070.00016.88
8.0.250.0000.00717.00
8.0.240.0060.00316.96
8.0.230.0030.00516.85
8.0.220.0040.00416.88
8.0.210.0000.00816.90
8.0.200.0030.00316.89
8.0.190.0040.00416.92
8.0.180.0070.00016.81
8.0.170.0030.00616.91
8.0.160.0000.00716.82
8.0.150.0000.00816.79
8.0.140.0050.00216.75
8.0.130.0000.00713.20
8.0.120.0040.00416.89
8.0.110.0040.00416.95
8.0.100.0000.00716.79
8.0.90.0000.00716.70
8.0.80.0100.00616.82
8.0.70.0000.00816.72
8.0.60.0000.00816.88
8.0.50.0030.00516.85
8.0.30.0110.01217.14
8.0.20.0150.00817.40
8.0.10.0080.00016.94
8.0.00.0160.00716.79
7.4.330.0000.00515.08
7.4.320.0000.00616.50
7.4.300.0000.00716.57
7.4.290.0030.00316.50
7.4.280.0000.00716.62
7.4.270.0000.00716.60
7.4.260.0030.00316.60
7.4.250.0000.00716.57
7.4.240.0020.00516.60
7.4.230.0090.00016.27
7.4.220.0090.00916.65
7.4.210.0070.00616.54
7.4.200.0040.00416.41
7.4.190.0040.00416.32
7.4.160.0060.01016.36
7.4.150.0090.00917.40
7.4.140.0120.00517.86
7.4.130.0100.00816.59
7.4.120.0120.00516.44
7.4.110.0100.00716.45
7.4.100.0110.01116.62
7.4.90.0060.01116.56
7.4.80.0060.01319.39
7.4.70.0090.00816.53
7.4.60.0030.01416.55
7.4.50.0090.00016.50
7.4.40.0110.00722.77
7.4.30.0190.00616.36
7.4.10.0090.00914.97
7.4.00.0090.00614.82
7.3.330.0000.00513.32
7.3.320.0000.00613.30
7.3.310.0000.00716.32
7.3.300.0070.00016.23
7.3.290.0040.01116.38
7.3.280.0120.00616.33
7.3.270.0060.01217.40
7.3.260.0050.01316.58
7.3.250.0090.01016.49
7.3.240.0130.00616.37
7.3.230.0130.00616.54
7.3.210.0100.00716.53
7.3.200.0160.00619.39
7.3.190.0150.00716.57
7.3.180.0060.01116.48
7.3.170.0080.01116.63
7.3.160.0130.00316.34
7.3.130.0070.01114.91
7.3.120.0100.00714.75
7.3.110.0050.01014.78
7.3.100.0050.00914.86
7.3.90.0080.00914.77
7.3.80.0070.00714.86
7.3.70.0050.00814.84
7.3.60.0080.00614.70
7.3.50.0050.00914.79
7.3.40.0100.00414.72
7.3.30.0070.00914.79
7.3.20.0040.01016.69
7.3.10.0060.00916.68
7.3.00.0080.00516.63
7.2.330.0090.00916.85
7.2.320.0140.00516.81
7.2.310.0070.01016.71
7.2.300.0070.01016.66
7.2.290.0120.00916.86
7.2.260.0080.01115.08
7.2.250.0080.00914.98
7.2.240.0070.01015.13
7.2.230.0060.01115.11
7.2.220.0100.00615.01
7.2.210.0070.00615.14
7.2.200.0060.00914.95
7.2.190.0060.01015.11
7.2.180.0040.01014.94
7.2.170.0070.00915.13
7.2.160.0060.00815.11
7.2.150.0060.00916.88
7.2.140.0060.00916.98
7.2.130.0060.00916.91
7.2.120.0060.00916.89
7.2.110.0060.00716.83
7.2.100.0060.00816.91
7.2.90.0050.00916.90
7.2.80.0070.00616.86
7.2.70.0070.00916.75
7.2.60.0070.00516.98
7.2.50.0060.00816.98
7.2.40.0070.00716.94
7.2.30.0070.00816.93
7.2.20.0050.01016.80
7.2.10.0100.00716.96
7.2.00.0040.01117.31
7.1.330.0060.00915.75
7.1.320.0050.00915.73
7.1.310.0060.00615.75
7.1.300.0040.00915.81
7.1.290.0050.00815.79
7.1.280.0060.00715.69
7.1.270.0030.01015.74
7.1.260.0050.00815.80
7.1.250.0070.00615.69
7.1.240.0020.00915.89
7.1.230.0030.01015.63
7.1.220.0040.01215.67
7.1.210.0010.00915.76
7.1.200.0060.00615.98
7.1.190.0030.00615.54
7.1.180.0060.00815.71
7.1.170.0030.00815.57
7.1.160.0050.01115.74
7.1.150.0080.00615.71
7.1.140.0040.01015.81
7.1.130.0050.01015.67
7.1.120.0090.00715.72
7.1.110.0060.00515.93
7.1.100.0080.00516.56
7.1.90.0050.00915.57
7.1.80.0090.00615.83
7.1.70.0060.00716.43
7.1.60.0060.01016.93
7.1.50.0080.00616.21
7.1.40.0020.01015.59
7.1.30.0040.01115.66
7.1.20.0020.01115.70
7.1.10.0090.00315.65
7.1.00.0030.03217.95
7.0.330.0050.00615.21
7.0.320.0040.00815.51
7.0.310.0090.00415.31
7.0.300.0070.00515.31
7.0.290.0110.00215.43
7.0.280.0040.00815.42
7.0.270.0040.00915.38
7.0.260.0090.00515.37
7.0.250.0030.00815.31
7.0.240.0020.00915.41
7.0.230.0030.00815.33
7.0.220.0120.00315.09
7.0.210.0030.00915.15
7.0.200.0050.01015.76
7.0.190.0080.00515.51
7.0.180.0080.00315.36
7.0.170.0070.00615.25
7.0.160.0120.00215.37
7.0.150.0070.00515.27
7.0.140.0020.03117.64
7.0.130.0070.00815.24
7.0.120.0070.00915.38
7.0.110.0090.00615.37
7.0.100.0070.02216.77
7.0.90.0080.03316.86
7.0.80.0070.03216.96
7.0.70.0060.03016.95
7.0.60.0040.02816.86
7.0.50.0050.02616.94
7.0.40.0060.03015.72
7.0.30.0030.03415.77
7.0.20.0060.03415.62
7.0.10.0070.03315.62
7.0.00.0030.03315.67
5.6.400.0030.01014.67
5.6.390.0060.00314.38
5.6.380.0050.00914.24
5.6.370.0050.01114.10
5.6.360.0080.00414.58
5.6.350.0080.01014.59
5.6.340.0050.00814.34
5.6.330.0030.01314.49
5.6.320.0060.00414.29
5.6.310.0080.00314.21
5.6.300.0090.00514.70
5.6.290.0070.00314.44
5.6.280.0050.03016.60
5.6.270.0060.01014.13
5.6.260.0060.00814.18
5.6.250.0060.01816.50
5.6.240.0060.02316.56
5.6.230.0110.02716.46
5.6.220.0080.03116.32
5.6.210.0080.02916.46
5.6.200.0050.03416.60
5.6.190.0100.02416.52
5.6.180.0080.03016.50
5.6.170.0120.02616.66
5.6.160.0040.03316.46
5.6.150.0070.03116.48
5.6.140.0100.01716.60
5.6.130.0090.03016.50
5.6.120.0090.03116.66
5.6.110.0070.03116.65
5.6.100.0110.01716.66
5.6.90.0080.03216.51
5.6.80.0070.02916.35
5.6.70.0110.02516.22
5.6.60.0080.02916.30
5.6.50.0080.02916.30
5.6.40.0090.02016.31
5.6.30.0090.01816.33
5.6.20.0110.02716.33
5.6.10.0070.02916.40
5.6.00.0060.01816.28
5.5.380.0120.02816.41
5.5.370.0050.02316.21
5.5.360.0070.02816.33
5.5.350.0110.02316.21
5.5.340.0060.03716.48
5.5.330.0060.02916.55
5.5.320.0050.03016.49
5.5.310.0070.02716.42
5.5.300.0040.02716.49
5.5.290.0030.03316.40
5.5.280.0070.03216.49
5.5.270.0030.03616.45
5.5.260.0070.03316.61
5.5.250.0090.02916.38
5.5.240.0030.03316.23
5.5.230.0050.02916.08
5.5.220.0070.02716.24
5.5.210.0070.02916.35
5.5.200.0060.03116.37
5.5.190.0030.03316.30
5.5.180.0090.03116.36
5.5.170.0060.00714.29
5.5.160.0060.03216.14
5.5.150.0130.02616.12
5.5.140.0050.02316.32
5.5.130.0040.02516.07
5.5.120.0050.02916.16
5.5.110.0110.01716.32
5.5.100.0040.02116.31
5.5.90.0060.01816.17
5.5.80.0100.02716.16
5.5.70.0040.03516.04
5.5.60.0080.02716.13
5.5.50.0080.02716.22
5.5.40.0060.02716.32
5.5.30.0080.01916.03
5.5.20.0060.03316.29
5.5.10.0070.03016.24
5.5.00.0090.02416.35
5.4.450.0050.02913.76
5.4.440.0070.02913.99
5.4.430.0050.02813.85
5.4.420.0040.02913.88
5.4.410.0050.03213.92
5.4.400.0040.03213.74
5.4.390.0050.02913.74
5.4.380.0030.03113.85
5.4.370.0060.02613.60
5.4.360.0070.02513.53
5.4.350.0040.02913.76
5.4.340.0040.03213.68
5.4.330.0020.00611.03
5.4.320.0070.02913.64
5.4.310.0020.02213.77
5.4.300.0050.02513.60
5.4.290.0040.02713.66
5.4.280.0050.03013.59
5.4.270.0030.03113.63
5.4.260.0080.02613.86
5.4.250.0070.02813.60
5.4.240.0050.02713.63
5.4.230.0060.02613.71
5.4.220.0070.02413.57
5.4.210.0050.02913.80
5.4.200.0060.02713.53
5.4.190.0050.02913.72
5.4.180.0080.02613.78
5.4.170.0050.02713.66
5.4.160.0070.02913.55
5.4.150.0020.03113.63
5.4.140.0060.02812.72
5.4.130.0070.02912.73
5.4.120.0050.02712.89
5.4.110.0050.03012.90
5.4.100.0040.02012.87
5.4.90.0090.02312.79
5.4.80.0060.02712.89
5.4.70.0030.02712.72
5.4.60.0060.01712.64
5.4.50.0070.02112.96
5.4.40.0060.02812.93
5.4.30.0030.03012.84
5.4.20.0090.02112.79
5.4.10.0020.03012.80
5.4.00.0060.01812.73
5.3.290.0060.02112.15
5.3.280.0050.03011.88
5.3.270.0080.02411.94
5.3.260.0040.02911.99
5.3.250.0040.02912.02
5.3.240.0090.02511.89
5.3.230.0050.02711.91
5.3.220.0070.02911.87
5.3.210.0040.03211.81
5.3.200.0040.02811.71
5.3.190.0020.03311.86
5.3.180.0020.03211.90
5.3.170.0060.02611.83
5.3.160.0030.03111.88
5.3.150.0070.02611.94
5.3.140.0100.01611.88
5.3.130.0070.02911.84
5.3.120.0040.02811.88
5.3.110.0070.02311.86
5.3.100.0040.01911.70
5.3.90.0040.02411.71
5.3.80.0080.02311.56
5.3.70.0020.03111.57
5.3.60.0060.02511.79
5.3.50.0040.02311.77
5.3.40.0040.01711.49
5.3.30.0080.02711.67
5.3.20.0030.02911.45
5.3.10.0090.02511.52
5.3.00.0020.02911.40
5.2.170.0070.06311.60
5.2.160.0130.04711.60
5.2.150.0130.05711.60
5.2.140.0030.04311.60
5.2.130.0000.04011.60
5.2.120.0030.06011.60
5.2.110.0030.06311.60
5.2.100.0000.06711.60
5.2.90.0070.05011.60
5.2.80.0030.06711.60
5.2.70.0030.06711.60
5.2.60.0070.05011.60
5.2.50.0070.05711.60
5.2.40.0030.05711.60
5.2.30.0070.05711.60
5.2.20.0070.03311.60
5.2.10.0000.06011.60
5.2.00.0070.05711.60
5.1.60.0070.05011.60
5.1.50.0070.05311.60
5.1.40.0070.05011.60
5.1.30.0030.05011.60
5.1.20.0000.06011.60
5.1.10.0030.05711.60
5.1.00.0030.03011.60
5.0.50.0070.04011.60
5.0.40.0000.05011.60
5.0.30.0000.06311.60
5.0.20.0000.05011.60
5.0.10.0070.04011.60
5.0.00.0070.04011.60
4.4.90.0030.03711.60
4.4.80.0030.03311.60
4.4.70.0030.03311.60
4.4.60.0030.03311.60
4.4.50.0070.03011.60
4.4.40.0000.05011.60
4.4.30.0030.03311.60
4.4.20.0000.03311.60
4.4.10.0000.03711.60
4.4.00.0100.05011.60
4.3.110.0030.03311.60
4.3.100.0070.03011.60
4.3.90.0000.03711.60
4.3.80.0030.05011.60
4.3.70.0000.03311.60
4.3.60.0100.02711.60
4.3.50.0000.03311.60
4.3.40.0030.05711.60
4.3.30.0000.03711.60
4.3.20.0000.03711.60
4.3.10.0000.03311.60
4.3.00.0030.03311.60

preferences:
61.21 ms | 400 KiB | 5 Q