3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Collection implements Iterator { protected $array, $valid = false; public function __construct(array $a) { echo __METHOD__ . "\n"; $this->array = $a; } public function current() { echo __METHOD__ . "\n"; return current($this->array); } public function key() { echo __METHOD__ . "\n"; return key($this->array); } public function next() { echo __METHOD__ . "\n"; $this->valid = (false !== next($this->array)); } public function valid() { echo __METHOD__ . "\n"; return $this->valid; } public function rewind() { echo __METHOD__ . "\n"; $this->valid = (false !== reset($this->array)); } } class TestFilter extends FilterIterator { public function accept() { echo __METHOD__ . "\n"; #throw new Exception("Failure in Accept"); } } $test = new TestFilter(new Collection(array(0))); try { foreach ($test as $item) { echo $item; } } catch (Exception $e) { var_dump($e->getMessage()); } ?> ===DONE===

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.0140.00716.61
8.3.50.0110.01321.94
8.3.40.0180.00019.00
8.3.30.0110.00319.04
8.3.20.0070.00020.34
8.3.10.0040.00421.82
8.3.00.0080.00018.03
8.2.180.0100.01016.63
8.2.170.0090.00922.96
8.2.160.0110.00320.52
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0070.01126.16
8.2.120.0040.00421.09
8.2.110.0060.00621.07
8.2.100.0090.00317.71
8.2.90.0040.00417.91
8.2.80.0060.00317.97
8.2.70.0060.00317.50
8.2.60.0050.00317.93
8.2.50.0030.00618.07
8.2.40.0030.00718.09
8.2.30.0030.00618.08
8.2.20.0040.00417.61
8.2.10.0080.00017.95
8.2.00.0030.00517.61
8.1.280.0110.00425.92
8.1.270.0090.00023.96
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0090.00020.76
8.1.230.0070.00420.91
8.1.220.0030.00617.74
8.1.210.0040.00419.05
8.1.200.0060.00317.35
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0080.00018.70
8.1.160.0000.00722.02
8.1.150.0080.00018.93
8.1.140.0060.00317.38
8.1.130.0040.00417.90
8.1.120.0020.00517.38
8.1.110.0040.00417.50
8.1.100.0000.00717.43
8.1.90.0030.00717.51
8.1.80.0000.00817.54
8.1.70.0070.00017.39
8.1.60.0000.01217.50
8.1.50.0040.00417.45
8.1.40.0020.00517.44
8.1.30.0040.00417.52
8.1.20.0050.00217.68
8.1.10.0040.00417.57
8.1.00.0040.00417.49
8.0.300.0000.00819.86
8.0.290.0040.00416.75
8.0.280.0000.00718.38
8.0.270.0070.00017.28
8.0.260.0030.00317.27
8.0.250.0000.00717.02
8.0.240.0030.00316.95
8.0.230.0070.00016.83
8.0.220.0040.00416.87
8.0.210.0000.00716.88
8.0.200.0030.00316.90
8.0.190.0000.00716.93
8.0.180.0040.00416.88
8.0.170.0040.00416.98
8.0.160.0000.00716.84
8.0.150.0040.00416.89
8.0.140.0040.00416.88
8.0.130.0000.00613.39
8.0.120.0070.00016.77
8.0.110.0060.00316.84
8.0.100.0040.00416.85
8.0.90.0000.00716.80
8.0.80.0090.01316.95
8.0.70.0040.00416.93
8.0.60.0040.00416.76
8.0.50.0040.00416.94
8.0.30.0060.01617.23
8.0.20.0080.01117.40
8.0.10.0040.00416.85
8.0.00.0110.01116.91
7.4.330.0000.00515.00
7.4.320.0000.00616.49
7.4.300.0030.00316.55
7.4.290.0000.00716.51
7.4.280.0040.00416.55
7.4.270.0000.00816.61
7.4.260.0040.00716.58
7.4.250.0070.00016.44
7.4.240.0020.00516.54
7.4.230.0070.00016.72
7.4.220.0070.01116.70
7.4.210.0160.00416.49
7.4.200.0000.00716.51
7.4.160.0170.00616.43
7.4.150.0150.00617.40
7.4.140.0150.00517.86
7.4.130.0100.00716.45
7.4.120.0160.00616.66
7.4.110.0080.00816.54
7.4.100.0060.01316.58
7.4.90.0120.00616.53
7.4.80.0060.01819.39
7.4.70.0130.00816.70
7.4.60.0100.00716.38
7.4.50.0020.00216.39
7.4.40.0140.00816.63
7.4.30.0170.00016.50
7.4.10.0070.00315.16
7.4.00.0090.00814.93
7.3.330.0030.00313.31
7.3.320.0000.00513.32
7.3.310.0030.00316.35
7.3.300.0050.00216.27
7.3.290.0040.01116.23
7.3.280.0100.00716.31
7.3.270.0070.01317.40
7.3.260.0080.00816.29
7.3.250.0070.01016.44
7.3.240.0130.00616.57
7.3.230.0100.00616.39
7.3.210.0080.00916.27
7.3.200.0080.02019.39
7.3.190.0090.01216.57
7.3.180.0100.00616.31
7.3.170.0030.01216.40
7.3.160.0040.01116.34
7.3.130.0070.00715.01
7.3.120.0080.00814.92
7.3.110.0040.01514.77
7.3.100.0080.00914.91
7.3.90.0070.00914.86
7.3.80.0080.00515.15
7.3.70.0100.00314.91
7.3.60.0030.01114.94
7.3.50.0070.00514.73
7.3.40.0060.00714.69
7.3.30.0080.00514.88
7.3.20.0070.00516.59
7.3.10.0100.00316.67
7.3.00.0050.00816.71
7.2.330.0070.01016.51
7.2.320.0090.00916.79
7.2.310.0030.01416.85
7.2.300.0030.01216.78
7.2.290.0090.00616.77
7.2.260.0030.01515.23
7.2.250.0100.01015.13
7.2.240.0050.01015.19
7.2.230.0060.00915.03
7.2.220.0060.00815.28
7.2.210.0030.01014.89
7.2.200.0060.00714.92
7.2.190.0080.00915.01
7.2.180.0050.00615.21
7.2.170.0070.00915.00
7.2.160.0030.01315.32
7.2.150.0070.00317.07
7.2.140.0060.00316.83
7.2.130.0100.00717.00
7.2.120.0030.00616.87
7.2.110.0100.00317.03
7.2.100.0040.01116.90
7.2.90.0120.00417.15
7.2.80.0060.00916.93
7.2.70.0040.01416.61
7.2.60.0030.01317.14
7.2.50.0070.00716.90
7.2.40.0060.00916.71
7.2.30.0110.00716.74
7.2.20.0070.00716.75
7.2.10.0110.00317.18
7.2.00.0070.00518.16
7.1.330.0060.00815.76
7.1.320.0080.00615.80
7.1.310.0090.00315.96
7.1.300.0040.00815.78
7.1.290.0060.00615.60
7.1.280.0020.01215.64
7.1.270.0070.00515.70
7.1.260.0060.00615.71
7.1.250.0030.01015.83
7.1.240.0000.01315.83
7.1.230.0080.00615.84
7.1.220.0030.00715.57
7.1.210.0080.00815.88
7.1.200.0090.00015.80
7.1.190.0070.00715.89
7.1.180.0040.00415.80
7.1.170.0030.01015.47
7.1.160.0000.01215.89
7.1.150.0040.00815.80
7.1.140.0090.00615.77
7.1.130.0000.01115.87
7.1.120.0000.01515.91
7.1.110.0030.01015.96
7.1.100.0020.01116.73
7.1.90.0040.01215.59
7.1.80.0070.01015.63
7.1.70.0080.00616.47
7.1.60.0160.00317.47
7.1.50.0100.00916.36
7.1.40.0090.00015.86
7.1.30.0110.00015.46
7.1.20.0030.01415.69
7.1.10.0050.00515.69
7.1.00.0030.04419.12
7.0.330.0030.01015.25
7.0.320.0060.00615.64
7.0.310.0040.01115.47
7.0.300.0040.01115.46
7.0.290.0050.00515.55
7.0.280.0040.00815.53
7.0.270.0060.00915.54
7.0.260.0060.00615.35
7.0.250.0090.00315.58
7.0.240.0090.00315.31
7.0.230.0000.01415.48
7.0.220.0070.01015.46
7.0.210.0130.00315.14
7.0.200.0020.00716.08
7.0.190.0070.01015.56
7.0.180.0050.00515.22
7.0.170.0040.00815.40
7.0.160.0070.00315.31
7.0.150.0030.01015.57
7.0.140.0020.04018.69
7.0.130.0000.01515.39
7.0.120.0070.00715.53
7.0.110.0030.01015.30
7.0.100.0100.00315.50
7.0.90.0000.00915.59
7.0.80.0040.01115.46
7.0.70.0060.01215.09
7.0.60.0040.02418.50
7.0.50.0080.04016.70
7.0.40.0100.04516.71
7.0.30.0200.03816.75
7.0.20.0110.04616.72
7.0.10.0030.03116.80
7.0.00.0110.04016.82
5.6.400.0090.00014.35
5.6.390.0060.01014.55
5.6.380.0060.00614.46
5.6.370.0070.00714.44
5.6.360.0070.00714.33
5.6.350.0030.00914.65
5.6.340.0050.00514.20
5.6.330.0110.00314.51
5.6.320.0040.00714.46
5.6.310.0030.01214.64
5.6.300.0080.00614.74
5.6.290.0040.00814.34
5.6.280.0050.04117.82
5.6.270.0000.01514.42
5.6.260.0060.00614.36
5.6.250.0060.00614.61
5.6.240.0090.00014.29
5.6.230.0120.00014.28
5.6.220.0040.00714.49
5.6.210.0030.02417.42
5.6.200.0070.04316.32
5.6.190.0070.03117.55
5.6.180.0180.03717.36
5.6.170.0180.04017.54
5.6.160.0060.04617.32
5.6.150.0070.04416.18
5.6.140.0080.03816.19
5.6.130.0040.03616.16
5.6.120.0020.03117.70
5.6.110.0050.03517.78
5.6.100.0030.02517.71
5.6.90.0080.04517.62
5.6.80.0030.02917.34
5.6.70.0120.00314.29
5.6.60.0040.01214.25
5.6.50.0050.01014.21
5.6.40.0070.00914.39
5.6.30.0070.00714.49
5.6.20.0080.00514.09
5.6.10.0100.00514.16
5.6.00.0040.01114.27
5.5.380.0030.01014.32
5.5.370.0030.01014.49
5.5.360.0060.00614.22
5.5.350.0040.03917.31
5.5.340.0080.02216.19
5.5.330.0080.03217.35
5.5.320.0190.02517.14
5.5.310.0160.04617.38
5.5.300.0020.02516.39
5.5.290.0020.02516.27
5.5.280.0020.02817.60
5.5.270.0070.02017.59
5.5.260.0080.04317.57
5.5.250.0070.03217.34
5.5.240.0050.04517.19
5.5.230.0130.00614.29
5.5.220.0080.00814.35
5.5.210.0070.01014.59
5.5.200.0030.01314.57
5.5.190.0030.01214.43
5.5.180.0040.00814.31
5.5.170.0100.00714.18
5.5.160.0140.00013.93
5.5.150.0090.00314.14
5.5.140.0080.00414.52
5.5.130.0070.00714.50
5.5.120.0070.00714.27
5.5.110.0060.00614.32
5.5.100.0110.00314.40
5.5.90.0100.00313.96
5.5.80.0070.00714.42
5.5.70.0040.01114.14
5.5.60.0060.00313.88
5.5.50.0120.00314.12
5.5.40.0030.01014.03
5.5.30.0080.00014.19
5.5.20.0070.00414.08
5.5.10.0030.01014.61
5.5.00.0060.00814.31
5.4.450.0200.02715.02
5.4.440.0150.02215.40
5.4.430.0350.02115.19
5.4.420.0230.02215.25
5.4.410.0150.02315.01
5.4.400.0250.01815.21
5.4.390.0370.02715.17
5.4.380.0550.02715.07
5.4.370.0500.03214.82
5.4.360.1150.04414.97
5.4.350.0430.02614.77
5.4.340.0420.02814.89
5.4.330.0060.00011.12
5.4.320.0040.02811.83
5.4.310.0050.02011.79
5.4.300.0020.02511.83
5.4.290.0020.02411.78
5.4.280.0060.01911.75
5.4.270.0030.02211.73
5.4.260.0060.02111.68
5.4.250.0050.02211.64
5.4.240.0050.02111.68
5.4.230.0040.02711.69
5.4.220.0070.01811.76
5.4.210.0090.01811.88
5.4.200.0030.02311.83
5.4.190.0040.02011.79
5.4.180.0060.01911.78
5.4.170.0100.01711.82
5.4.160.0050.02611.64
5.4.150.0070.01811.77
5.4.140.0050.02211.72
5.4.130.0040.02311.75
5.4.120.0060.02011.75
5.4.110.0050.01911.52
5.4.100.0060.01911.46
5.4.90.0070.02211.69
5.4.80.0040.01911.55
5.4.70.0050.02011.48
5.4.60.0060.01811.50
5.4.50.0050.02111.56
5.4.40.0040.02211.46
5.4.30.0040.02111.60
5.4.20.0040.02311.58
5.4.10.0020.02411.48
5.4.00.0050.02011.31
5.3.290.0060.02111.79
5.3.280.0050.02211.61
5.3.270.0030.02611.71
5.3.260.0030.02611.68
5.3.250.0070.02311.73
5.3.240.0100.01711.66
5.3.230.0060.02111.67
5.3.220.0040.02111.56
5.3.210.0050.02411.59
5.3.200.0020.02311.58
5.3.190.0050.02211.50
5.3.180.0040.02211.67
5.3.170.0050.02011.63
5.3.160.0060.02211.67
5.3.150.0060.02111.49
5.3.140.0040.02011.61
5.3.130.0040.02111.60
5.3.120.0060.02211.62
5.3.110.0060.02111.58
5.3.100.0040.02611.26
5.3.90.0020.02411.35
5.3.80.0030.02211.22
5.3.70.0080.01811.18
5.3.60.0060.02011.23
5.3.50.0050.01811.26
5.3.40.0050.02111.28
5.3.30.0060.02111.23
5.3.20.0060.01811.21
5.3.10.0060.02011.00
5.3.00.0030.02111.05
5.2.170.0050.0299.23
5.2.160.0040.0379.23
5.2.150.0090.0299.23
5.2.140.0060.0319.23
5.2.130.0030.0319.19
5.2.120.0010.0329.19
5.2.110.0030.0309.19
5.2.100.0040.0299.19
5.2.90.0020.0319.19
5.2.80.0050.0329.19
5.2.70.0070.0319.19
5.2.60.0060.0289.14
5.2.50.0050.0329.11
5.2.40.0060.0289.08
5.2.30.0020.0329.07
5.2.20.0040.0299.05
5.2.10.0060.0278.96
5.2.00.0030.0318.82
5.1.60.0040.0248.10
5.1.50.0050.0248.10
5.1.40.0030.0258.08
5.1.30.0050.0268.43
5.1.20.0030.0288.45
5.1.10.0040.0298.18
5.1.00.0060.0248.17
5.0.50.0030.0216.64
5.0.40.0020.0216.50
5.0.30.0010.0346.32
5.0.20.0040.0196.28
5.0.10.0060.0246.26
5.0.00.0030.0406.25
4.4.90.0020.0234.78
4.4.80.0030.0184.76
4.4.70.0060.0194.75
4.4.60.0030.0184.76
4.4.50.0030.0154.77
4.4.40.0040.0244.70
4.4.30.0030.0154.76
4.4.20.0050.0134.84
4.4.10.0020.0164.85
4.4.00.0020.0264.76
4.3.110.0010.0174.67
4.3.100.0020.0154.66
4.3.90.0020.0174.64
4.3.80.0030.0244.58
4.3.70.0040.0134.63
4.3.60.0010.0174.63
4.3.50.0010.0174.63
4.3.40.0050.0234.54
4.3.30.0040.0193.30
4.3.20.0020.0213.28
4.3.10.0050.0153.23
4.3.00.0000.02015.29

preferences:
45.25 ms | 401 KiB | 5 Q