3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Container implements Iterator { private $container; private $iterator; public function __construct() { $this->container = new ArrayObject(); $this->iterator = $this->container->getIterator(); } public function append($element) { $this->container->append($element); } public function current() { return $this->iterator->current(); } public function next() { $this->iterator->next(); } public function key() { return $this->iterator->key(); } public function valid() { return $this->iterator->valid(); } public function rewind() { $this->iterator->rewind(); } } $nb = pack('H*', '00'); $php5 = 'O:9:"Container":2:{s:20:"' . $nb . 'Container' . $nb . 'container";C:11:"ArrayObject":53:{x:i:0;a:2:{i:0;s:5:"test1";i:1;s:5:"test2";};m:a:0:{}}s:19:"' . $nb . 'Container' . $nb . 'iterator";C:13:"ArrayIterator":26:{x:i:16777216;r:2;;m:a:0:{}}}'; $container = unserialize($php5); var_dump($container); foreach ($container as $key => $value) { echo $key . ' => ' . $value . 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.4.120.0110.00924.03
8.4.110.0090.01219.10
8.4.100.0110.00919.02
8.4.90.0040.00420.46
8.4.80.0080.01219.09
8.4.70.0150.00622.48
8.4.60.0100.01017.68
8.4.50.0050.00419.81
8.4.40.0160.00717.75
8.4.30.0160.00318.03
8.4.20.0000.01019.71
8.4.10.0090.00019.50
8.3.250.0110.00417.11
8.3.240.0130.00617.28
8.3.230.0090.00916.55
8.3.220.0090.00618.84
8.3.210.0160.00316.61
8.3.200.0030.00516.66
8.3.190.0070.00916.65
8.3.180.0100.00916.79
8.3.170.0060.01216.73
8.3.160.0150.00316.52
8.3.150.0160.00317.18
8.3.140.0180.00016.35
8.3.130.0040.00418.71
8.3.120.0030.00518.86
8.3.110.0000.01020.94
8.3.100.0130.00716.84
8.3.90.0070.00718.43
8.3.80.0100.00018.55
8.3.70.0150.00618.58
8.3.60.0070.01416.61
8.3.50.0120.00618.36
8.3.40.0090.00618.61
8.3.30.0070.01118.70
8.3.20.0080.00020.19
8.3.10.0040.00421.92
8.3.00.0000.00823.48
8.2.290.0100.00920.53
8.2.280.0110.01016.95
8.2.270.0140.00417.41
8.2.260.0080.00018.26
8.2.250.0040.00416.50
8.2.240.0060.00319.16
8.2.230.0070.00022.58
8.2.220.0030.00624.06
8.2.210.0060.00326.77
8.2.200.0090.00016.50
8.2.190.0000.01516.75
8.2.180.0060.00918.18
8.2.170.0110.01122.96
8.2.160.0070.00719.24
8.2.150.0050.00324.18
8.2.140.0090.00924.66
8.2.130.0040.00426.16
8.2.120.0080.00019.38
8.2.110.0030.00622.09
8.2.100.0070.00417.91
8.2.90.0080.00022.27
8.2.80.0090.00018.03
8.2.70.0050.00318.04
8.2.60.0050.00318.05
8.2.50.0000.00818.10
8.2.40.0040.00420.45
8.2.30.0000.00719.30
8.2.20.0000.00717.98
8.2.10.0000.00718.06
8.2.00.0030.00717.97
8.1.330.0110.00922.01
8.1.320.0100.01116.38
8.1.310.0000.00816.53
8.1.300.0060.00318.45
8.1.290.0060.00318.88
8.1.280.0030.01325.92
8.1.270.0100.00022.13
8.1.260.0090.00026.35
8.1.250.0080.00028.09
8.1.240.0040.00820.82
8.1.230.0080.00320.96
8.1.220.0080.00017.76
8.1.210.0080.00018.88
8.1.200.0060.00317.35
8.1.190.0050.00317.25
8.1.180.0030.00518.10
8.1.170.0030.00518.65
8.1.160.0080.00018.86
8.1.150.0000.00720.02
8.1.140.0000.00819.59
8.1.130.0000.00819.03
8.1.120.0050.00317.52
8.1.110.0000.00917.46
8.1.100.0000.00817.52
8.1.90.0050.00417.47
8.1.80.0040.00417.51
8.1.70.0040.00417.42
8.1.60.0050.00217.58
8.1.50.0050.00317.49
8.1.40.0040.00417.58
8.1.30.0050.00317.52
8.1.20.0040.00417.65
8.1.10.0000.00817.59
8.1.00.0040.00417.53
8.0.300.0070.00020.07
8.0.290.0080.00016.88
8.0.280.0040.00418.51
8.0.270.0080.00016.80
8.0.260.0000.00718.51
8.0.250.0030.00316.89
8.0.240.0070.00017.07
8.0.230.0000.01117.05
8.0.220.0040.00416.98
8.0.210.0000.00716.97
8.0.200.0030.00316.96
8.0.190.0000.00916.98
8.0.180.0040.00416.85
8.0.170.0000.00717.01
8.0.160.0050.00316.95
8.0.150.0070.00316.98
8.0.140.0030.00616.79
8.0.130.0030.00313.35
8.0.120.0020.00516.84
8.0.110.0000.00816.89
8.0.100.0050.00216.85
8.0.90.0000.00716.84
8.0.80.0110.00416.96
8.0.70.0050.00216.86
8.0.60.0070.00016.84
8.0.50.0040.00416.86
8.0.30.0060.01216.95
8.0.20.0090.01317.41
8.0.10.0050.00216.94
8.0.00.0070.01116.61
7.4.330.0030.00315.55
7.4.320.0060.00016.51
7.4.300.0000.00616.40
7.4.290.0000.00816.65
7.4.280.0030.00316.59
7.4.270.0000.00716.59
7.4.260.0030.00316.40
7.4.250.0030.00316.38
7.4.240.0030.00316.37
7.4.230.0070.00016.70
7.4.220.0000.00716.63
7.4.210.0060.00916.71
7.4.200.0000.00716.63
7.4.160.0070.01016.52
7.4.150.0090.00917.40
7.4.140.0090.01017.86
7.4.130.0060.01216.53
7.4.120.0060.01216.58
7.4.110.0130.01016.63
7.4.100.0070.01116.66
7.4.90.0150.00416.70
7.4.80.0110.00719.39
7.4.70.0200.00316.66
7.4.60.0070.01016.56
7.4.50.0000.01316.67
7.4.40.0090.01216.69
7.4.30.0060.01016.44
7.4.00.0090.00814.93
7.3.330.0030.00313.32
7.3.320.0020.00213.21
7.3.310.0000.00816.29
7.3.300.0040.00416.40
7.3.290.0090.01016.39
7.3.280.0060.01016.37
7.3.270.0100.01617.40
7.3.260.0130.00816.62
7.3.250.0120.00816.47
7.3.240.0080.00816.55
7.3.230.0170.00016.39
7.3.210.0080.00816.55
7.3.200.0060.00916.35
7.3.190.0110.00516.42
7.3.180.0030.01416.40
7.3.170.0130.00316.46
7.3.160.0060.01016.66
7.3.120.0030.01715.00
7.3.110.0120.00614.71
7.3.100.0100.01014.99
7.3.90.0040.01114.96
7.3.80.0060.00914.58
7.3.70.0030.01215.00
7.3.60.0110.00414.81
7.3.50.0030.01014.90
7.3.40.0030.01314.89
7.3.30.0110.00414.63
7.3.20.0090.00316.79
7.3.10.0030.00716.64
7.3.00.0070.00716.73
7.2.330.0060.01216.76
7.2.320.0140.00316.46
7.2.310.0130.01016.39
7.2.300.0070.01016.63
7.2.290.0110.00616.54
7.2.250.0130.00715.29
7.2.240.0040.01415.21
7.2.230.0070.01015.29
7.2.220.0040.01115.15
7.2.210.0000.01515.21
7.2.200.0130.00315.00
7.2.190.0140.00315.15
7.2.180.0060.00614.73
7.2.170.0040.00915.11
7.2.60.0090.00017.02
7.1.330.0120.00315.81
7.1.320.0090.00615.70
7.1.310.0000.01115.40
7.1.300.0100.00315.90
7.1.290.0030.00715.74
7.1.280.0080.00415.79
7.1.270.0000.01715.93
7.1.260.0040.00415.82
7.1.200.0070.00415.54
7.1.100.5330.00715.93
7.1.90.5050.00916.10
7.1.80.3060.01216.24
7.1.70.4820.01615.18
7.1.60.2980.01333.32
7.1.50.2660.01333.04
7.1.40.2590.00732.62
7.1.30.3030.01632.65
7.1.20.2700.01332.59
7.1.10.2750.01014.78
7.1.00.3040.01314.80
7.0.240.3670.01315.71
7.0.230.4390.01015.96
7.0.220.3470.01315.75
7.0.210.3520.01014.88
7.0.200.4010.00015.04
7.0.190.3940.00714.79
7.0.180.1770.01314.32
7.0.170.3850.01014.45
7.0.160.3470.02014.45
7.0.150.2970.00614.52
7.0.140.2400.01714.35
7.0.130.2190.00714.58
7.0.120.2670.01314.80
7.0.110.2420.00714.42
7.0.100.2600.01314.54
7.0.90.2430.01314.63
7.0.80.2330.00314.80
7.0.70.2350.00314.43
7.0.60.2450.00614.27
7.0.50.2020.00714.64
7.0.40.1750.01314.84
7.0.30.1830.02114.73
7.0.20.3020.01014.55
7.0.10.1920.00314.54
7.0.00.2150.01014.51

preferences:
29.46 ms | 403 KiB | 5 Q