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(); } } $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; }

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.0160.00616.88
8.3.50.0070.00718.18
8.3.40.0120.00318.84
8.3.30.0120.00318.84
8.3.20.0000.00821.64
8.3.10.0040.00421.95
8.3.00.0000.00819.69
8.2.180.0090.00625.92
8.2.170.0140.00019.09
8.2.160.0080.00522.96
8.2.150.0040.00424.18
8.2.140.0070.00724.66
8.2.130.0000.00822.08
8.2.120.0100.00726.35
8.2.110.0030.00622.20
8.2.100.0080.00317.72
8.2.90.0040.00417.75
8.2.80.0030.00617.97
8.2.70.0090.00017.63
8.2.60.0040.00417.63
8.2.50.0040.00417.93
8.2.40.0050.00319.35
8.2.30.0050.00319.32
8.2.20.0060.00318.06
8.2.10.0040.00418.03
8.2.00.0000.00718.05
8.1.280.0060.00925.92
8.1.270.0000.00823.81
8.1.260.0030.00526.35
8.1.250.0070.00028.09
8.1.240.0030.00623.84
8.1.230.0080.00419.04
8.1.220.0000.00917.79
8.1.210.0080.00018.77
8.1.200.0110.00017.35
8.1.190.0030.00617.23
8.1.180.0000.00818.10
8.1.170.0000.00917.62
8.1.160.0000.00818.77
8.1.150.0000.00718.94
8.1.140.0040.00419.58
8.1.130.0000.00718.89
8.1.120.0000.00717.34
8.1.110.0040.00417.32
8.1.100.0040.00417.38
8.1.90.0000.00717.54
8.1.80.0040.00417.36
8.1.70.0000.00817.53
8.1.60.0000.00817.62
8.1.50.0110.00017.53
8.1.40.0000.01017.58
8.1.30.0040.00417.68
8.1.20.0000.00817.69
8.1.10.0040.00417.61
8.1.00.0000.00817.53
8.0.300.0060.00319.73
8.0.290.0000.00716.63
8.0.280.0070.00018.46
8.0.270.0000.00716.74
8.0.260.0000.00617.14
8.0.250.0070.00017.10
8.0.240.0080.00017.04
8.0.230.0040.00416.91
8.0.220.0000.00716.97
8.0.210.0040.00416.98
8.0.200.0000.00717.03
8.0.190.0040.00417.09
8.0.180.0050.00217.03
8.0.170.0020.00516.99
8.0.160.0030.00316.84
8.0.150.0070.00416.86
8.0.140.0020.00516.86
8.0.130.0060.00013.38
8.0.120.0040.00416.92
8.0.110.0070.00016.83
8.0.100.0040.00416.91
8.0.90.0080.00016.79
8.0.80.0060.00916.94
8.0.70.0060.00316.87
8.0.60.0000.00817.00
8.0.50.0070.00016.95
8.0.30.0100.00817.18
8.0.20.0120.00917.40
8.0.10.0000.00717.09
8.0.00.0060.01216.77
7.4.330.0040.00415.55
7.4.320.0030.00516.59
7.4.300.0060.00016.50
7.4.290.0000.00716.55
7.4.280.0050.00316.61
7.4.270.0030.00316.52
7.4.260.0030.00616.36
7.4.250.0040.00416.56
7.4.240.0050.00216.59
7.4.230.0000.00716.42
7.4.220.0000.02016.42
7.4.210.0090.00616.42
7.4.200.0000.00716.61
7.4.160.0070.01016.48
7.4.150.0110.00717.40
7.4.140.0080.01017.86
7.4.130.0110.00716.73
7.4.120.0120.01216.52
7.4.110.0100.01316.54
7.4.100.0090.00916.41
7.4.90.0100.00716.55
7.4.80.0090.00919.39
7.4.70.0040.01316.63
7.4.60.0060.00916.41
7.4.50.0000.01416.55
7.4.40.0080.01216.38
7.4.30.0130.00916.47
7.4.00.0060.00614.66
7.3.330.0030.00213.27
7.3.320.0000.00513.30
7.3.310.0000.00916.27
7.3.300.0000.00716.25
7.3.290.0040.01216.31
7.3.280.0100.00816.31
7.3.270.0120.01217.40
7.3.260.0090.00916.31
7.3.250.0100.00716.50
7.3.240.0160.00316.48
7.3.230.0090.00916.45
7.3.210.0090.00916.61
7.3.200.0120.00616.51
7.3.190.0200.00316.17
7.3.180.0000.01616.63
7.3.170.0090.01416.64
7.3.160.0170.00016.35
7.3.60.0030.00914.61
7.3.50.0070.00714.79
7.3.40.0140.00314.94
7.3.30.0100.01314.91
7.3.20.0040.01816.70
7.3.10.0120.00016.55
7.3.00.0080.00716.55
7.2.330.0120.00616.80
7.2.320.0130.00716.79
7.2.310.0080.00816.82
7.2.300.0110.00616.39
7.2.290.0150.00216.87
7.2.190.0030.01114.79
7.2.180.0000.02215.20
7.2.170.0070.01615.15
7.2.160.0090.00414.90
7.2.150.0090.00917.06
7.2.140.0080.00416.84
7.2.130.0080.00916.88
7.2.120.0080.01116.76
7.2.110.0110.00816.75
7.2.100.0080.00716.96
7.2.90.0090.01016.80
7.2.80.0110.00316.72
7.2.70.0130.00616.77
7.2.60.0080.00716.93
7.2.50.0100.01016.66
7.2.40.0070.01216.88
7.2.30.0070.00817.05
7.2.20.0100.01016.73
7.2.10.0080.00817.02
7.2.00.0060.00616.80
7.1.300.0000.01415.70
7.1.290.0040.00715.65
7.1.280.0040.00815.68
7.1.270.0000.01415.97
7.1.260.0070.00415.95
7.1.250.0110.00415.69
7.1.240.0100.00715.74
7.1.230.0160.00415.51
7.1.220.0130.00615.63
7.1.210.0140.00315.70
7.1.200.0110.00615.54
7.1.190.0150.00715.67
7.1.180.0210.00315.59
7.1.170.0150.00315.88
7.1.160.0080.01015.61
7.1.150.0100.00715.65
7.1.140.0130.00815.74
7.1.130.0090.00615.56
7.1.120.0130.00715.67
7.1.110.0080.01115.62
7.1.100.0770.01015.92
7.1.90.0700.01015.63
7.1.80.0700.01315.81
7.1.70.0610.00715.84
7.1.60.0770.01120.45
7.1.50.0710.01120.40
7.1.40.0430.01120.03
7.1.30.0470.00920.19
7.1.20.0520.00920.18
7.1.10.0450.00815.58
7.1.00.0500.00715.75
7.0.330.0110.00515.26
7.0.320.0110.00615.27
7.0.310.0110.00815.28
7.0.300.0100.01215.16
7.0.290.0090.00715.51
7.0.280.0190.00515.25
7.0.270.0130.00815.33
7.0.260.0090.00815.35
7.0.250.0100.00515.48
7.0.240.0790.00615.36
7.0.230.0940.00615.56
7.0.220.0820.00615.48
7.0.210.1100.01015.17
7.0.200.1220.00915.49
7.0.190.0800.00515.67
7.0.180.0570.01015.43
7.0.170.0560.00715.43
7.0.160.0380.01015.34
7.0.150.0420.00915.33
7.0.140.0710.00715.31
7.0.130.0620.00915.49
7.0.120.0560.01015.45
7.0.110.0540.00715.33
7.0.100.0570.00715.33
7.0.90.0420.00715.33
7.0.80.0510.01115.37
7.0.70.0570.00715.48
7.0.60.0600.00615.33
7.0.50.0580.00715.44
7.0.40.0660.00814.57
7.0.30.0650.00814.45
7.0.20.0710.00714.49
7.0.10.0640.00914.51
7.0.00.0630.01114.56
5.6.400.0190.01614.68
5.6.390.0140.00913.93
5.6.380.0120.00414.39
5.6.370.0080.01014.58
5.6.360.0180.00014.02
5.6.350.0100.00714.45
5.6.340.0190.00514.56
5.6.330.0100.00713.95
5.6.320.0190.00614.39
5.6.310.0170.01014.45
5.6.300.0100.03618.64
5.6.290.0100.04618.59
5.6.280.0140.05018.65
5.6.270.0110.05318.64
5.6.260.0140.03818.75
5.6.250.0140.04018.73
5.6.240.0120.04118.70
5.6.230.0160.03818.67
5.6.220.0100.04118.68
5.6.210.0110.04518.44
5.6.200.0120.03818.75
5.6.190.0120.05818.70
5.6.180.0090.05718.71
5.6.170.0140.04418.76
5.6.160.0190.05018.69
5.6.150.0150.04418.70
5.6.140.0110.03618.56
5.6.130.0110.03518.79
5.6.120.0130.03318.75
5.6.110.0110.03618.73
5.6.100.0150.03418.69
5.6.90.0160.03918.66
5.6.80.0100.04618.19
5.6.70.0210.04218.30
5.6.60.0080.05518.29
5.6.50.0140.03218.18
5.6.40.0120.03418.27
5.6.30.0110.03318.23
5.6.20.0150.03118.27
5.6.10.0080.04418.21
5.6.00.0130.03718.38
5.5.380.0070.01314.52
5.5.370.0050.01414.48
5.5.360.0090.00914.30
5.5.350.0110.01814.51
5.5.340.0200.00314.28
5.5.330.0160.00814.58
5.5.320.0090.01414.45
5.5.310.0130.00714.14
5.5.300.0150.00014.59
5.5.290.0100.00614.11
5.5.280.0060.01114.27
5.5.270.0160.00314.39
5.5.260.0220.00014.32
5.5.250.0120.01013.94
5.5.240.0180.00014.36
5.5.230.0140.01114.48
5.5.220.0090.01714.19
5.5.210.0110.00514.09
5.5.200.0140.00514.14
5.5.190.0090.00814.27
5.5.180.0150.00414.43
5.5.170.0160.00714.41
5.5.160.0130.01014.32
5.5.150.0090.00914.33
5.5.140.0140.01014.29
5.5.130.0110.00714.35
5.5.120.0120.00614.43
5.5.110.0100.00714.26
5.5.100.0150.00714.07
5.5.90.0130.00914.20
5.5.80.0150.00714.11
5.5.70.0130.00514.17
5.5.60.0090.00914.39
5.5.50.0140.00514.13
5.5.40.0190.00214.25
5.5.30.0110.00814.03
5.5.20.0160.00714.16
5.5.10.0100.00314.13
5.5.00.0190.00614.40
5.4.450.0110.00511.03
5.4.440.0130.00911.07
5.4.430.0090.01211.39
5.4.420.0110.01111.25
5.4.410.0050.00811.20
5.4.400.0100.01010.88
5.4.390.0120.01011.41
5.4.380.0150.00511.08
5.4.370.0070.00711.22
5.4.360.0070.00610.73
5.4.350.0110.00711.14
5.4.340.0080.00611.21
5.4.330.0070.01310.84
5.4.320.0060.00610.95
5.4.310.0100.00310.99
5.4.300.0070.00711.18
5.4.290.0130.00010.88
5.4.280.0060.00611.29
5.4.270.0130.00011.38
5.4.260.0140.00011.25
5.4.250.0090.00611.08
5.4.240.0180.00411.32
5.4.230.0170.00011.04
5.4.220.0110.01111.27
5.4.210.0050.00911.00
5.4.200.0050.00810.97
5.4.190.0070.00710.99
5.4.180.0100.00010.85
5.4.170.0000.01510.69
5.4.160.0090.00510.93
5.4.150.0080.01511.14
5.4.140.0070.01010.93
5.4.130.0150.00611.10
5.4.120.0130.00911.02
5.4.110.0070.00711.32
5.4.100.0080.00810.93
5.4.90.0040.00711.07
5.4.80.0070.01111.05
5.4.70.0130.00310.86
5.4.60.0140.01111.05
5.4.50.0040.00811.00
5.4.40.0090.00910.92
5.4.30.0030.01010.81
5.4.20.0140.00511.06
5.4.10.0130.00611.16
5.4.00.0130.00410.99
5.3.290.0090.00910.82
5.3.280.0070.00710.33
5.3.270.0090.00310.63
5.3.260.0170.01010.65
5.3.250.0050.01110.61
5.3.240.0000.01210.44
5.3.230.0170.00610.58
5.3.220.0050.00810.50
5.3.210.0140.00410.50
5.3.200.0100.00210.37
5.3.190.0200.00310.34
5.3.180.0100.00710.75
5.3.170.0160.00410.56
5.3.160.0110.00510.46
5.3.150.0030.00810.69
5.3.140.0080.00410.45
5.3.130.0120.00010.56
5.3.120.0150.00810.45
5.3.110.0230.00010.66
5.3.100.0070.00410.67
5.3.90.0090.00710.45
5.3.80.0070.01010.52
5.3.70.0080.00410.55
5.3.60.0040.00710.49
5.3.50.0140.00310.62
5.3.40.0110.00510.39
5.3.30.0070.00510.57
5.3.20.0090.00610.60
5.3.10.0050.00510.45
5.3.00.0030.01110.35
5.2.170.0070.0039.68
5.2.160.0070.0059.68
5.2.150.0060.0039.68
5.2.140.0060.0039.68
5.2.130.0000.0109.68
5.2.120.0100.0059.68
5.2.110.0080.0009.68
5.2.100.0000.0109.68
5.2.90.0070.0049.68
5.2.80.0080.0029.68
5.2.70.0100.0059.68
5.2.60.0070.0049.68
5.2.50.0070.0109.68
5.2.40.0120.0009.68
5.2.30.0070.0049.68
5.2.20.0050.0109.68
5.2.10.0080.0049.68
5.2.00.0070.0039.68
5.1.60.0000.0079.68
5.1.50.0000.0079.68
5.1.40.0080.0089.68
5.1.30.0050.0049.68
5.1.20.0110.0049.68
5.1.10.0090.0039.68
5.1.00.0060.0039.68
5.0.50.0090.0039.68
5.0.40.0040.0049.68
5.0.30.0110.0049.68
5.0.20.0080.0039.68
5.0.10.0050.0059.68
5.0.00.0070.0049.68
4.4.90.0040.0059.68
4.4.80.0110.0009.68
4.4.70.0090.0029.68
4.4.60.0060.0009.68
4.4.50.0060.0009.68
4.4.40.0060.0049.68
4.4.30.0070.0009.68
4.4.20.0060.0069.68
4.4.10.0000.0059.68
4.4.00.0070.0009.68
4.3.110.0030.0039.68
4.3.100.0090.0039.68
4.3.90.0060.0009.68
4.3.80.0060.0039.68
4.3.70.0030.0069.68
4.3.60.0040.0089.68
4.3.50.0030.0039.68
4.3.40.0030.0039.68
4.3.30.0060.0069.68
4.3.20.0040.0029.68
4.3.10.0000.0069.68
4.3.00.0000.0049.68

preferences:
62.64 ms | 401 KiB | 5 Q