3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $val; public function __construct($val) { $this->val = $val; } } $storage = new SplObjectStorage; for($i = 1; $i <= 10; $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.70.0040.01116.50
8.3.60.0110.00416.75
8.3.50.0070.00717.54
8.3.40.0070.00718.65
8.3.30.0060.01218.59
8.3.20.0080.00018.51
8.3.10.0090.00018.42
8.3.00.0050.00319.25
8.2.180.0100.00716.63
8.2.170.0100.00722.96
8.2.160.0150.00018.85
8.2.150.0050.00524.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0000.00721.05
8.2.110.0070.00320.99
8.2.100.0060.00617.91
8.2.90.0050.00319.09
8.2.80.0050.00318.00
8.2.70.0030.00617.50
8.2.60.0050.00318.04
8.2.50.0030.00517.93
8.2.40.0080.00019.35
8.2.30.0060.00317.72
8.2.20.0100.00017.57
8.2.10.0060.00317.68
8.2.00.0000.00717.77
8.1.280.0040.01125.92
8.1.270.0040.00423.99
8.1.260.0050.00326.35
8.1.250.0030.00528.09
8.1.240.0090.00020.81
8.1.230.0040.00817.83
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0000.00817.35
8.1.190.0050.00317.22
8.1.180.0030.00618.69
8.1.170.0000.00817.62
8.1.160.0030.00318.96
8.1.150.0040.00418.59
8.1.140.0040.00417.49
8.1.130.0000.00717.50
8.1.120.0030.00517.37
8.1.110.0020.00517.48
8.1.100.0070.00017.51
8.1.90.0070.00017.52
8.1.80.0000.00717.49
8.1.70.0000.00617.47
8.1.60.0000.00717.52
8.1.50.0080.00017.38
8.1.40.0000.00917.57
8.1.30.0030.00617.57
8.1.20.0000.00717.71
8.1.10.0050.00217.63
8.1.00.0000.00717.51
8.0.300.0000.00818.77
8.0.290.0000.00816.75
8.0.280.0000.00718.60
8.0.270.0030.00317.35
8.0.260.0040.00416.77
8.0.250.0040.00416.96
8.0.240.0050.00317.00
8.0.230.0020.00517.00
8.0.220.0070.00016.91
8.0.210.0000.00716.91
8.0.200.0000.00616.88
8.0.190.0050.00316.98
8.0.180.0040.00416.96
8.0.170.0080.00016.70
8.0.160.0000.00716.83
8.0.150.0080.00016.92
8.0.140.0000.00916.94
8.0.130.0060.00313.34
8.0.120.0030.00616.72
8.0.110.0000.00816.94
8.0.100.0000.00716.80
8.0.90.0040.00416.97
8.0.80.0120.00916.89
8.0.70.0030.00416.91
8.0.60.0060.00316.89
8.0.50.0080.00016.88
8.0.30.0070.01117.09
8.0.20.0070.01117.13
8.0.10.0000.00816.86
8.0.00.0080.01116.82
7.4.330.0000.00413.00
7.4.320.0040.00416.44
7.4.300.0000.00616.54
7.4.290.0000.00816.67
7.4.280.0070.00016.62
7.4.270.0050.00316.64
7.4.260.0050.00013.32
7.4.250.0000.00816.54
7.4.240.0000.00716.57
7.4.230.0000.00816.68
7.4.220.0100.01316.60
7.4.210.0100.00716.48
7.4.200.0000.00716.53
7.4.190.0070.00016.77
7.4.160.0060.00916.83
7.4.150.0170.00716.61
7.4.140.0000.01717.86
7.4.130.0110.01516.61
7.4.120.0090.00916.44
7.4.110.0070.01116.55
7.4.100.0110.00616.47
7.4.90.0070.01316.59
7.4.80.0090.01219.39
7.4.70.0150.00316.55
7.4.60.0040.01216.45
7.4.50.0000.00516.43
7.4.40.0070.00516.23
7.4.30.0130.01016.62
7.4.00.0100.00514.91
7.3.330.0000.00613.39
7.3.320.0030.00313.32
7.3.310.0040.00416.18
7.3.300.0030.00316.34
7.3.290.0050.01016.37
7.3.280.0030.00616.39
7.3.270.0170.00016.48
7.3.260.0090.00916.31
7.3.240.0060.01016.67
7.3.230.0140.00716.53
7.3.210.0120.00916.57
7.3.200.0130.00616.67
7.3.190.0060.01616.41
7.3.180.0040.01416.44
7.3.170.0080.00816.32
7.3.160.0150.00616.66
7.3.120.0050.01314.71
7.3.110.0030.01314.84
7.3.100.0080.00614.79
7.3.90.0050.00815.09
7.3.80.0050.00814.75
7.3.70.0030.01114.82
7.3.60.0000.01014.93
7.3.50.0050.00714.81
7.3.40.0080.00414.86
7.3.30.0100.00514.93
7.3.20.0050.01016.62
7.3.10.0070.01016.69
7.3.00.0050.00716.46
7.2.330.0090.00916.69
7.2.320.0080.00816.46
7.2.310.0080.01516.82
7.2.300.0080.00816.42
7.2.290.0160.00616.69
7.2.250.0120.00515.01
7.2.240.0060.00915.02
7.2.230.0100.00515.04
7.2.220.0050.01114.88
7.2.210.0070.00814.95
7.2.200.0040.01215.19
7.2.190.0070.00714.96
7.2.180.0060.00914.96
7.2.170.0030.01015.06
7.2.160.0080.00814.97
7.2.150.0070.01016.77
7.2.140.0000.01016.89
7.2.130.0070.00417.13
7.2.120.0100.00316.92
7.2.110.0040.00716.99
7.2.100.0030.00616.75
7.2.90.0070.01117.02
7.2.80.0140.00416.97
7.2.70.0060.00916.71
7.2.60.0080.00416.77
7.2.50.0030.01316.83
7.2.40.0060.00617.09
7.2.30.0090.00616.86
7.2.20.0070.01016.75
7.2.10.0030.00616.70
7.2.00.0090.00518.19
7.1.330.0100.00515.74
7.1.320.0080.00715.73
7.1.310.0060.00815.80
7.1.300.0080.00515.91
7.1.290.0030.01015.85
7.1.280.0030.00715.67
7.1.270.0030.01215.73
7.1.260.0050.00715.88
7.1.250.0080.00515.62
7.1.240.0050.00515.52
7.1.230.0040.01115.75
7.1.220.0060.00315.84
7.1.210.0000.01415.86
7.1.200.0030.01015.73
7.1.190.0030.01015.96
7.1.180.0060.00915.87
7.1.170.0030.01315.81
7.1.160.0100.00315.81
7.1.150.0040.00415.86
7.1.140.0060.00315.89
7.1.130.0090.00615.74
7.1.120.0070.00315.52
7.1.110.0070.00315.84
7.1.100.0100.00616.96
7.1.90.0050.00315.57
7.1.80.0070.00415.85
7.1.70.0040.00716.45
7.1.60.0080.01217.38
7.1.50.0050.01216.40
7.1.40.0000.01015.93
7.1.30.0030.00715.88
7.1.20.0030.00715.70
7.1.10.0060.00615.98
7.1.00.0030.04318.99
7.0.330.0030.00915.23
7.0.320.0040.01115.36
7.0.310.0040.00815.28
7.0.300.0060.00915.52
7.0.290.0040.00815.12
7.0.280.0060.00315.14
7.0.270.0090.00315.57
7.0.260.0040.00415.51
7.0.250.0000.01415.21
7.0.240.0070.00715.50
7.0.230.0060.00615.50
7.0.220.0000.01015.38
7.0.210.0040.01115.47
7.0.200.0020.00916.03
7.0.190.0030.01315.41
7.0.180.0060.00615.67
7.0.170.0030.00915.31
7.0.160.0060.00315.49
7.0.150.0080.00815.49
7.0.140.0020.04218.61
7.0.130.0030.01015.29
7.0.120.0100.00715.50
7.0.110.0040.01115.46
7.0.100.0040.01115.55
7.0.90.0060.00915.20
7.0.80.0090.00315.43
7.0.70.0030.01015.31
7.0.60.0050.03817.55
7.0.50.0070.02416.61
7.0.40.0040.03916.84
7.0.30.0170.03316.82
7.0.20.0080.03516.77
7.0.10.0060.04316.85
7.0.00.0020.04016.77
5.6.400.0000.01314.38
5.6.390.0040.00814.28
5.6.380.0100.00314.36
5.6.370.0060.00614.04
5.6.360.0090.00614.37
5.6.350.0000.01414.37
5.6.340.0030.00914.35
5.6.330.0030.00614.07
5.6.320.0030.01014.52
5.6.310.0040.00814.18
5.6.300.0080.00014.81
5.6.290.0030.00613.96
5.6.280.0070.03617.50
5.6.270.0030.00714.16
5.6.260.0120.00314.38
5.6.250.0000.00914.34
5.6.240.0040.00814.46
5.6.230.0090.00614.31
5.6.220.0060.00914.54
5.6.210.0050.04317.52
5.6.200.0100.04216.37
5.6.190.0090.04417.41
5.6.180.0270.03317.40
5.6.170.0160.04017.44
5.6.160.0090.02417.45
5.6.150.0100.03116.28
5.6.140.0050.04516.29
5.6.130.0070.04516.32
5.6.120.0020.02817.65
5.6.110.0080.03517.76
5.6.100.0060.02817.63
5.6.90.0130.03817.61
5.6.80.0020.03117.33
5.6.70.0030.01014.46
5.6.60.0030.01114.05
5.6.50.0070.00714.43
5.6.40.0000.00914.45
5.6.30.0040.00714.08
5.6.20.0040.00814.42
5.6.10.0070.00714.34
5.6.00.0060.00314.31
5.5.380.0060.00314.34
5.5.370.0040.00814.42
5.5.360.0030.00614.58
5.5.350.0040.03017.41
5.5.340.0070.03916.24
5.5.330.0100.03917.10
5.5.320.0650.02317.29
5.5.310.0200.03017.30
5.5.300.0110.03716.21
5.5.290.0080.04415.99
5.5.280.0080.04617.54
5.5.270.0050.04217.50
5.5.260.0100.04017.58
5.5.250.0080.04317.40
5.5.240.0130.03517.32
5.5.230.0040.00414.29
5.5.220.0040.00714.39
5.5.210.0070.00714.56
5.5.200.0000.00814.46
5.5.190.0060.00914.26
5.5.180.0060.00614.41
5.5.170.0030.00614.30
5.5.160.0060.00614.34
5.5.150.0000.01614.50
5.5.140.0030.01014.41
5.5.130.0000.01214.39
5.5.120.0030.01014.36
5.5.110.0040.00814.51
5.5.100.0000.01114.20
5.5.90.0030.01014.44
5.5.80.0000.01114.13
5.5.70.0080.00414.34
5.5.60.0080.00614.41
5.5.50.0000.01314.29
5.5.40.0080.00414.33
5.5.30.0070.00714.07
5.5.20.0060.00614.47
5.5.10.0040.01114.15
5.5.00.0070.00714.47
5.4.450.0220.02215.78
5.4.440.0180.02015.75
5.4.430.0200.02215.82
5.4.420.0360.02015.82
5.4.410.0280.02015.83
5.4.400.0430.02815.49
5.4.390.0110.02615.69
5.4.380.0450.02015.69
5.4.370.0270.01815.64
5.4.360.0300.01915.55
5.4.350.0270.02815.65
5.4.340.0300.02815.67
5.4.330.0050.00212.16
5.4.320.0300.02815.60
5.4.310.0320.02115.57
5.4.300.0280.02515.65
5.4.290.0230.01915.55
5.4.280.0390.02415.60
5.4.270.0440.02015.55
5.4.260.0270.02415.65
5.4.250.0230.02315.65
5.4.240.0180.03015.65
5.4.230.0080.02115.60
5.4.220.0310.02115.67
5.4.210.0180.03115.64
5.4.200.0310.02615.54
5.4.190.0400.02115.50
5.4.180.0410.01615.63
5.4.170.0320.02215.59
5.4.160.0220.02915.63
5.4.150.0220.02515.63
5.4.140.0150.02514.41
5.4.130.0400.01814.23
5.4.120.0380.02114.24
5.4.110.0300.01814.21
5.4.100.0470.02514.36
5.4.90.0180.02314.20
5.4.80.0220.02114.29
5.4.70.0130.02014.36
5.4.60.0420.02114.35
5.4.50.0170.02614.28
5.4.40.0220.01814.34
5.4.30.0270.01714.34
5.4.20.0330.02114.36
5.4.10.0200.02414.28
5.4.00.0250.02014.18
5.3.290.0400.02214.19
5.3.280.0460.01814.18
5.3.270.0390.02214.18
5.3.260.0210.02914.18
5.3.250.0260.02714.18
5.3.240.0200.02414.18
5.3.230.0280.02014.18
5.3.220.0550.01614.18
5.3.210.0470.02014.18
5.3.200.0380.01714.18
5.3.190.0180.02814.18
5.3.180.0350.01614.18
5.3.170.0290.02314.18
5.3.160.0230.02014.18
5.3.150.0310.01814.18
5.3.140.0260.02514.18
5.3.130.0230.02114.18
5.3.120.0220.02514.18
5.3.110.0350.01714.18
5.3.100.0270.01614.18
5.3.90.0170.02714.18
5.3.80.0210.01614.18
5.3.70.0290.01714.18
5.3.60.0250.02214.18
5.3.50.0480.02214.18
5.3.40.0200.01914.18
5.3.30.0350.02714.18
5.3.20.0150.02514.18
5.3.10.0190.02414.18
5.3.00.0140.02914.18
5.2.170.0600.03716.21
5.2.160.0300.03316.21
5.2.150.0230.04016.21
5.2.140.0200.03316.21
5.2.130.0770.02016.21
5.2.120.0700.03316.21
5.2.110.0430.02016.21
5.2.100.0570.03316.21
5.2.90.0370.03316.21
5.2.80.0670.03016.21
5.2.70.0670.03316.21
5.2.60.0330.02716.21
5.2.50.0500.03316.21
5.2.40.0530.02716.21
5.2.30.0330.03316.21
5.2.20.0470.03016.21
5.2.10.0600.03016.21
5.2.00.0430.02716.21
5.1.60.0330.02716.21
5.1.50.0230.02316.21
5.1.40.0300.03716.21
5.1.30.0530.02716.21
5.1.20.0500.02316.21
5.1.10.0300.03016.21
5.1.00.0300.02016.21
5.0.50.0230.02016.21
5.0.40.0200.02016.21
5.0.30.0000.03016.21
5.0.20.0100.01316.21
5.0.10.0100.01316.21
5.0.00.0330.02716.21
4.4.90.0200.02316.21
4.4.80.0230.01316.21
4.4.70.0330.01316.21
4.4.60.0000.01316.21
4.4.50.0200.01316.21
4.4.40.0170.02716.21
4.4.30.0030.01716.21
4.4.20.0100.01716.21
4.4.10.0130.01716.21
4.4.00.0170.02316.21
4.3.110.0270.02316.21
4.3.100.0200.01716.21
4.3.90.0200.01016.21
4.3.80.0100.02316.21
4.3.70.0170.01716.21
4.3.60.0270.01016.21
4.3.50.0030.02016.21
4.3.40.0170.02716.21
4.3.30.0070.01316.21
4.3.20.0130.01316.21
4.3.10.0030.02016.21
4.3.00.0070.01716.21

preferences:
45.13 ms | 401 KiB | 5 Q