3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ConstructorException extends Exception {} class Foo extends ArrayObject { public function __construct( $arr = array(), $flags = 0, $iterator = 'FooIterator' ) { parent::__construct( $arr, $flags, $iterator ); } /** * @return ArrayIterator */ public function getIterator() { $class = $this->getIteratorClass(); return new $class($this); } } class FooIterator extends ArrayIterator { function __construct( $array = array(), $flags = 0 ) { throw new ConstructorException( 'HELLO WORLD' ); // I AM NEVER CALLED. parent::__construct( $array, $flags ); } } try { $f = new Foo( array( 1, 2, 3 ) ); $it = $f->getIterator(); if ( get_class( $it ) !== 'FooIterator' ) { throw new Exception( 'Expected iterator to be FooIterator.' ); } die( "FAIL\n" ); } catch ( ConstructorException $e ) { die( "PASS\n" ); } catch ( \Exception $e ) { die( sprintf( "ERROR: %s\n", $e->getMessage() ) ); }

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.0180.00316.63
8.3.50.0130.00621.11
8.3.40.0060.00918.79
8.3.30.0130.00619.04
8.3.20.0040.00420.16
8.3.10.0080.00023.59
8.3.00.0030.00717.63
8.2.180.0090.00618.15
8.2.170.0110.00422.96
8.2.160.0070.00720.39
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0030.00526.16
8.2.120.0070.00021.00
8.2.110.0000.01122.13
8.2.100.0060.00617.91
8.2.90.0040.00417.91
8.2.80.0050.00318.99
8.2.70.0060.00317.80
8.2.60.0100.00317.80
8.2.50.0040.00418.10
8.2.40.0030.00519.35
8.2.30.0000.00717.91
8.2.20.0000.00917.60
8.2.10.0050.00217.92
8.2.00.0000.00718.14
8.1.280.0090.00625.92
8.1.270.0030.00520.33
8.1.260.0000.00826.35
8.1.250.0030.01028.09
8.1.240.0030.00620.88
8.1.230.0000.01220.93
8.1.220.0090.00017.76
8.1.210.0080.00018.77
8.1.200.0030.00717.35
8.1.190.0000.00817.35
8.1.180.0060.00318.10
8.1.170.0050.00318.54
8.1.160.0020.00522.21
8.1.150.0020.00518.95
8.1.140.0000.00817.43
8.1.130.0000.00717.85
8.1.120.0000.00717.53
8.1.110.0000.00817.50
8.1.100.0050.00217.43
8.1.90.0000.00717.37
8.1.80.0000.00717.52
8.1.70.0000.00717.47
8.1.60.0040.00917.61
8.1.50.0100.00017.45
8.1.40.0050.00317.54
8.1.30.0040.00417.65
8.1.20.0040.00417.64
8.1.10.0060.00317.59
8.1.00.0000.00817.56
8.0.300.0070.00020.21
8.0.290.0000.00716.75
8.0.280.0040.00418.28
8.0.270.0030.00316.85
8.0.260.0000.00717.14
8.0.250.0060.00316.97
8.0.240.0030.00316.99
8.0.230.0030.00317.04
8.0.220.0030.00316.82
8.0.210.0000.00716.87
8.0.200.0000.00716.96
8.0.190.0030.00616.89
8.0.180.0030.00516.95
8.0.170.0000.00817.03
8.0.160.0070.00016.89
8.0.150.0030.00516.81
8.0.140.0040.00416.97
8.0.130.0060.00013.42
8.0.120.0050.00316.84
8.0.110.0000.00717.04
8.0.100.0050.00216.88
8.0.90.0070.00017.09
8.0.80.0070.01117.07
8.0.70.0000.00816.76
8.0.60.0000.00716.77
8.0.50.0040.00416.80
8.0.30.0110.01117.00
8.0.20.0120.01017.40
8.0.10.0040.00416.91
8.0.00.0040.01316.97
7.4.330.0050.00015.09
7.4.320.0060.00016.58
7.4.300.0030.00316.51
7.4.290.0000.00816.62
7.4.280.0000.00716.42
7.4.270.0030.00316.53
7.4.260.0000.01116.65
7.4.250.0040.00416.47
7.4.240.0020.00616.50
7.4.230.0000.00716.73
7.4.220.0070.00016.47
7.4.210.0040.01416.63
7.4.200.0080.00016.64
7.4.160.0090.00616.66
7.4.150.0100.01317.40
7.4.140.0100.00717.86
7.4.130.0060.01216.53
7.4.120.0060.01116.45
7.4.110.0140.01016.56
7.4.100.0060.01616.32
7.4.90.0120.00616.54
7.4.80.0090.00919.39
7.4.70.0110.00716.70
7.4.60.0100.00716.65
7.4.50.0040.00416.63
7.4.40.0090.01316.45
7.4.30.0070.01016.70
7.4.00.0040.01114.85
7.3.330.0020.00213.47
7.3.320.0060.00613.45
7.3.310.0000.00816.54
7.3.300.0000.00716.46
7.3.290.0060.00016.48
7.3.280.0080.00816.43
7.3.270.0130.00317.40
7.3.260.0070.01016.73
7.3.250.0070.01116.47
7.3.240.0000.01716.52
7.3.230.0140.00816.39
7.3.210.0100.00716.42
7.3.200.0150.00619.39
7.3.190.0180.00016.48
7.3.180.0030.01316.36
7.3.170.0070.01416.73
7.3.160.0080.00816.50
7.3.10.0060.00916.53
7.3.00.0030.00816.71
7.2.330.0070.01116.74
7.2.320.0110.00616.82
7.2.310.0030.01916.62
7.2.300.0000.01616.74
7.2.290.0160.00616.71
7.2.130.0060.00617.00
7.2.120.0070.00516.93
7.2.110.0110.00316.87
7.2.100.0070.00416.69
7.2.90.0060.00716.98
7.2.80.0070.00616.97
7.2.70.0050.00716.78
7.2.60.0020.00916.90
7.2.50.0090.00516.95
7.2.40.0050.00916.95
7.2.30.0040.00917.01
7.2.20.0000.01416.94
7.2.10.0060.00617.02
7.2.00.0110.00316.92
7.1.250.0030.01015.68
7.1.240.0110.00015.88
7.1.230.0000.01315.66
7.1.220.0070.00715.55
7.1.210.0100.00315.77
7.1.200.0020.00815.82
7.1.190.0070.00715.45
7.1.180.0070.00315.72
7.1.170.0030.00715.47
7.1.160.0030.01315.82
7.1.150.0070.00315.68
7.1.140.0100.00315.86
7.1.130.0070.00715.73
7.1.120.0090.00315.76
7.1.110.0000.01015.96
7.1.100.0040.00815.63
7.1.90.0060.00615.94
7.1.80.0030.00815.70
7.1.70.0040.00616.46
7.1.60.0050.01117.67
7.1.50.0050.01016.37
7.1.40.0070.00715.68
7.1.30.0080.00015.53
7.1.20.0030.01015.71
7.1.10.0000.00815.84
7.1.00.0020.04419.10
7.0.330.0070.00415.35
7.0.320.0030.00714.96
7.0.310.0070.00715.25
7.0.300.0000.00915.25
7.0.290.0000.01215.20
7.0.280.0030.01215.61
7.0.270.0070.00715.38
7.0.260.0090.00615.17
7.0.250.0000.01415.22
7.0.240.0030.00615.46
7.0.230.0030.00615.43
7.0.220.0120.00015.55
7.0.210.0040.00815.46
7.0.200.0060.00616.16
7.0.190.0030.00715.26
7.0.180.0080.00315.39
7.0.170.0030.01015.20
7.0.160.0070.00315.19
7.0.150.0000.01115.08
7.0.140.0030.01315.04
7.0.130.0040.00715.40
7.0.120.0120.00315.04
7.0.110.0080.00315.50
7.0.100.0060.00315.45
7.0.90.0050.00515.37
7.0.80.0030.00615.46
7.0.70.0000.01215.08
7.0.60.0130.03817.50
7.0.50.0030.05016.60
7.0.40.0040.02516.94
7.0.30.0400.03316.79
7.0.20.0120.04016.82
7.0.10.0050.02716.79
7.0.00.0030.04516.84
5.6.380.0040.00714.61
5.6.370.0080.00513.89
5.6.360.0000.01313.88
5.6.350.0030.01014.38
5.6.340.0060.00614.14
5.6.330.0090.00314.28
5.6.320.0060.00913.93
5.6.310.0040.00713.92
5.6.300.0090.00314.55
5.6.290.0030.01014.26
5.6.280.0040.04017.60
5.6.270.0070.00714.20
5.6.260.0050.00513.90
5.6.250.0000.01313.92
5.6.240.0030.00713.95
5.6.230.0070.00314.10
5.6.220.0030.00914.32
5.6.210.0120.04017.20
5.6.200.0030.02516.08
5.6.190.0040.04317.26
5.6.180.0160.02917.31
5.6.170.0140.02017.24
5.6.160.0040.04617.22
5.6.150.0080.02816.19
5.6.140.0100.01816.10
5.6.130.0110.03816.18
5.6.120.0030.05117.54
5.6.110.0070.04117.53
5.6.100.0070.04417.53
5.6.90.0080.03617.40
5.6.80.0080.02317.36
5.6.70.1330.02017.20
5.6.60.0000.01014.06
5.6.50.0050.00314.11
5.6.40.0030.00714.18
5.6.30.0030.01013.88
5.6.20.0070.00314.23
5.6.10.0030.01014.28
5.6.00.0080.00614.09
5.5.380.0070.00311.08
5.5.370.0030.00610.72
5.5.360.0000.00610.95
5.5.350.0130.03715.86
5.5.340.0060.04314.57
5.5.330.0050.03615.81
5.5.320.0150.02215.60
5.5.310.0220.03715.74
5.5.300.0030.04914.61
5.5.290.0020.04714.69
5.5.280.0050.04516.14
5.5.270.0150.03715.87
5.5.260.0070.02316.01
5.5.250.0080.03615.79
5.5.240.1950.02015.53
5.5.230.0070.00310.52
5.5.220.0090.00010.61
5.5.210.0050.00310.89
5.5.200.0030.00610.84
5.5.190.0080.00010.84
5.5.180.0050.00510.90
5.5.170.0030.00610.65
5.5.160.0030.01011.04
5.5.150.0000.00611.16
5.5.140.0030.00711.22
5.5.130.0000.00910.63
5.5.120.0060.00311.16
5.5.110.0000.01211.16
5.5.100.0000.00811.19
5.5.90.0030.00511.05
5.5.80.0110.00011.13
5.5.70.0060.00311.02
5.5.60.0070.00411.16
5.5.50.0030.00310.85
5.5.40.0030.00710.87
5.5.30.0050.00310.79
5.5.20.0030.00311.19
5.5.10.0060.00611.10
5.5.00.0110.00011.16
5.4.450.0110.02315.15
5.4.440.0090.02315.25
5.4.430.0100.02315.13
5.4.420.0050.03315.16
5.4.410.0030.03415.10
5.4.400.0130.02814.89
5.4.390.0060.03114.62
5.4.380.0080.03714.70
5.4.370.0070.04014.72
5.4.360.0080.04014.69
5.4.350.0080.04014.79
5.4.340.0070.03214.89
5.4.330.0060.00310.79
5.4.320.0080.03114.85
5.4.310.0100.02714.77
5.4.300.0020.03514.88
5.4.290.0090.02914.87
5.4.280.0090.03014.90
5.4.270.0080.03514.73
5.4.260.0080.02914.74
5.4.250.0090.03014.87
5.4.240.0090.03914.80
5.4.230.0030.03614.88
5.4.220.0100.03014.88
5.4.210.0030.03414.83
5.4.200.0100.02313.66
5.4.190.0090.02714.91
5.4.180.0030.03914.78
5.4.170.0080.02914.78
5.4.160.0050.03214.83
5.4.150.0090.03914.82
5.4.140.0070.04113.73
5.4.130.0080.03013.62
5.4.120.0100.02513.66
5.4.110.0020.03213.67
5.4.100.0080.02513.72
5.4.90.0110.03113.64
5.4.80.0020.03613.68
5.4.70.0070.02813.75
5.4.60.0070.02913.57
5.4.50.0090.02313.74
5.4.40.0030.03513.54
5.4.30.0080.02513.49
5.4.20.0070.03013.52
5.4.10.0070.02713.55
5.4.00.0020.03213.38
5.3.290.0120.02612.59
5.3.280.0070.02812.77
5.3.270.0070.03012.64
5.3.260.0170.02912.51
5.3.250.0070.03012.80
5.3.240.0090.02712.59
5.3.230.0060.03012.63
5.3.220.0020.03512.55
5.3.210.0030.03312.65
5.3.200.0070.02812.58
5.3.190.0130.02512.57
5.3.180.0080.02812.64
5.3.170.0070.02812.69
5.3.160.0080.02712.65
5.3.150.0070.02812.69
5.3.140.0100.02312.52
5.3.130.0090.02912.56
5.3.120.0070.03012.70
5.3.110.0110.02912.62
5.3.100.0070.02712.37
5.3.90.0070.03512.37
5.3.80.0090.03512.30
5.3.70.0050.02912.35
5.3.60.0150.02512.29
5.3.50.0080.02912.32
5.3.40.0100.02512.42
5.3.30.0030.03512.25
5.3.20.0090.02712.18
5.3.10.0050.03112.07
5.3.00.0040.03011.96
5.2.170.0030.02610.36
5.2.160.0030.02310.48
5.2.150.0080.02210.39
5.2.140.0090.02010.36
5.2.130.0070.02010.36
5.2.120.0050.02310.43
5.2.110.0050.02310.39
5.2.100.0050.02110.28
5.2.90.0050.02110.38
5.2.80.0020.02610.29
5.2.70.0100.02810.31
5.2.60.0110.02510.26
5.2.50.0020.03510.40
5.2.40.0050.02810.41
5.2.30.0030.02410.35
5.2.20.0120.01710.23
5.2.10.0130.01510.20
5.2.00.0080.01810.09
5.1.60.0050.0209.75
5.1.50.0040.0199.74
5.1.40.0030.0209.72
5.1.30.0020.0249.89
5.1.20.0080.02210.00
5.1.10.0070.0239.78
5.1.00.0070.0259.82
5.0.50.0100.0159.01
5.0.40.0030.0209.02
5.0.30.0030.0308.90
5.0.20.0030.0208.86
5.0.10.0010.0248.81
5.0.00.0050.0238.84
4.4.90.0020.0137.65
4.4.80.0030.0127.66
4.4.70.0000.0157.68
4.4.60.0030.0117.67
4.4.50.0040.0147.66
4.4.40.0030.0187.69
4.4.30.0020.0147.66
4.4.20.0050.0117.68
4.4.10.0030.0127.71
4.4.00.0060.0167.67
4.3.110.0030.0117.61
4.3.100.0020.0127.62
4.3.90.0050.0137.62
4.3.80.0000.0237.62
4.3.70.0030.0127.62
4.3.60.0030.0117.64
4.3.50.0000.0137.61
4.3.40.0000.0207.58
4.3.30.0000.0147.01
4.3.20.0030.0127.01
4.3.10.0020.0137.01
4.3.00.0000.01012.96

preferences:
34.6 ms | 401 KiB | 5 Q