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 get_iterator() { return $this->iterator; } 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(); } } class Page { private $content; public function __construct($content) { $this->content = $content; } public function get_content() { return $this->content; } } $container = new Container(); $container->append('test1'); $container->append('test2'); $serialized = serialize($container); unset($container); $container = unserialize($serialized); foreach ($container as $key => $value) { echo $key . ' => ' . $value . PHP_EOL; } echo $serialized . PHP_EOL; var_dump($container); var_dump($container->get_iterator());

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.0130.00316.86
8.3.50.0120.00318.25
8.3.40.0060.00918.84
8.3.30.0090.00618.67
8.3.20.0040.00421.73
8.3.10.0040.00421.77
8.3.00.0040.00419.56
8.2.180.0140.00716.50
8.2.170.0070.00722.96
8.2.160.0100.00319.30
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0050.00319.77
8.2.110.0070.00321.11
8.2.100.0040.00817.91
8.2.90.0000.00819.15
8.2.80.0000.00817.97
8.2.70.0000.00917.63
8.2.60.0060.00318.03
8.2.50.0090.00018.10
8.2.40.0030.00620.59
8.2.30.0040.00419.21
8.2.20.0000.00818.03
8.2.10.0000.00818.09
8.2.00.0070.00018.00
8.1.280.0100.00725.92
8.1.270.0000.00823.97
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0000.00923.98
8.1.230.0110.00017.71
8.1.220.0000.00817.79
8.1.210.0030.00618.77
8.1.200.0060.00317.48
8.1.190.0000.00817.35
8.1.180.0090.00018.10
8.1.170.0000.00918.47
8.1.160.0040.00418.92
8.1.150.0070.00318.84
8.1.140.0070.00019.52
8.1.130.0000.00718.80
8.1.120.0050.00217.54
8.1.110.0040.00417.46
8.1.100.0000.00817.37
8.1.90.0050.00317.39
8.1.80.0070.00017.47
8.1.70.0070.00017.40
8.1.60.0000.00817.50
8.1.50.0000.01017.45
8.1.40.0030.00617.57
8.1.30.0030.00617.61
8.1.20.0000.00717.69
8.1.10.0040.00417.47
8.1.00.0030.00517.43
8.0.300.0050.00218.77
8.0.290.0000.00716.75
8.0.280.0050.00318.47
8.0.270.0070.00017.23
8.0.260.0070.00017.21
8.0.250.0030.00317.05
8.0.240.0000.00716.96
8.0.230.0030.00316.95
8.0.220.0070.00017.04
8.0.210.0030.00517.04
8.0.200.0030.00317.02
8.0.190.0030.00617.02
8.0.180.0020.00516.92
8.0.170.0040.00417.04
8.0.160.0040.00417.03
8.0.150.0030.00716.91
8.0.140.0070.00016.98
8.0.130.0060.00013.46
8.0.120.0000.00816.98
8.0.110.0040.00416.86
8.0.100.0050.00317.08
8.0.90.0000.00717.02
8.0.80.0090.01316.94
8.0.70.0000.00716.77
8.0.60.0070.00016.99
8.0.50.0070.00016.84
8.0.30.0110.00917.14
8.0.20.0110.01017.43
8.0.10.0080.00017.17
8.0.00.0160.00916.82
7.4.330.0080.00015.55
7.4.320.0060.00016.57
7.4.300.0030.00316.59
7.4.290.0030.00316.46
7.4.280.0040.00416.56
7.4.270.0030.00316.69
7.4.260.0040.00416.57
7.4.250.0040.00416.42
7.4.240.0080.00016.68
7.4.230.0070.00016.53
7.4.220.0160.00316.46
7.4.210.0100.01116.73
7.4.200.0050.00316.52
7.4.160.0160.00216.77
7.4.150.0030.01617.40
7.4.140.0120.01017.86
7.4.130.0110.00816.65
7.4.120.0160.00716.52
7.4.110.0130.00516.47
7.4.100.0100.00716.46
7.4.90.0080.00816.54
7.4.80.0110.00619.39
7.4.70.0090.00916.60
7.4.60.0100.00616.50
7.4.50.0030.01016.52
7.4.40.0040.01316.45
7.4.30.0030.01416.64
7.4.00.0140.00315.16
7.3.330.0030.00313.20
7.3.320.0060.00013.31
7.3.310.0080.00016.25
7.3.300.0000.00716.20
7.3.290.0040.01016.29
7.3.280.0110.00816.30
7.3.270.0080.01017.40
7.3.260.0130.00916.44
7.3.250.0110.00816.48
7.3.240.0110.00916.60
7.3.230.0090.00916.35
7.3.210.0090.00916.44
7.3.200.0090.00916.54
7.3.190.0150.00416.52
7.3.180.0100.00516.53
7.3.170.0090.00916.45
7.3.160.0030.01516.58
7.3.10.0130.00216.65
7.3.00.0070.00816.79
7.2.330.0100.01016.71
7.2.320.0100.01416.79
7.2.310.0150.00316.48
7.2.300.0160.00316.67
7.2.290.0100.00716.81
7.2.130.0060.00916.87
7.2.120.0050.00816.82
7.2.110.0060.00816.72
7.2.100.0090.00516.96
7.2.90.0040.00916.98
7.2.80.0030.01217.01
7.2.70.0060.00616.82
7.2.60.0110.00516.93
7.2.50.0030.00717.01
7.2.40.0060.00617.00
7.2.30.0050.00716.89
7.2.20.0130.00616.95
7.2.10.0120.00316.76
7.2.00.0090.00717.65
7.1.250.0060.00615.71
7.1.240.0060.00915.88
7.1.230.0120.00415.69
7.1.220.0060.00615.81
7.1.210.0030.00915.84
7.1.200.0060.00415.80
7.1.190.0030.00716.00
7.1.180.0150.00315.90
7.1.170.0060.00615.85
7.1.160.0130.00315.86
7.1.150.0030.00715.68
7.1.140.0000.01215.85
7.1.130.0000.00915.79
7.1.120.0030.01015.86
7.1.110.0030.00715.82
7.1.100.0120.00315.63
7.1.90.0030.01315.67
7.1.80.0030.00615.81
7.1.70.0070.00816.55
7.1.60.0030.00616.52
7.1.50.0130.01325.24
7.1.40.0180.01125.04
7.1.30.0110.00825.04
7.1.20.0100.01024.94
7.1.10.0050.00716.10
7.1.00.0020.01016.05
7.0.330.0000.01615.45
7.0.320.0070.00715.44
7.0.310.0070.00715.39
7.0.300.0060.00615.29
7.0.290.0040.01115.38
7.0.280.0100.00415.34
7.0.270.0080.00615.57
7.0.260.0030.01115.36
7.0.250.0070.01015.21
7.0.240.0040.00715.14
7.0.230.0130.00315.19
7.0.220.0070.00715.46
7.0.210.0060.00615.48
7.0.200.0020.01316.19
7.0.190.0090.00315.84
7.0.180.0050.01015.82
7.0.170.0080.00715.73
7.0.160.0030.00915.79
7.0.150.0070.00715.74
7.0.140.0070.00715.76
7.0.130.0060.00815.97
7.0.120.0110.00215.79
7.0.110.0050.00815.79
7.0.100.0050.00815.81
7.0.90.0090.00715.74
7.0.80.0030.01015.73
7.0.70.0060.00815.85
7.0.60.0050.00815.69
7.0.50.0030.00915.88
7.0.40.0020.01114.93
7.0.30.0050.00614.97
7.0.20.0070.00714.84
7.0.10.0050.00614.85
7.0.00.0030.00814.83
5.6.380.0000.01514.09

preferences:
91.65 ms | 401 KiB | 5 Q