3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FooBar implements Iterator { function __construct() { echo "Constructing new FooBar\n"; } function __destruct() { echo "Destructing FooBar\n"; } function current () { throw new Exception; } function key () { return 0; } function next () {} function rewind () {} function valid () { return true; } } function foo() { try { $f = new FooBar; yield from $f; } catch (Exception $e) { echo "[foo()] Caught Exception\n"; } } function bar() { echo "Starting bar()\n"; $x = foo(); try { var_dump($x->current()); } catch (Exception $e) { var_dump($x->key()); echo "Caught Exception\n"; } echo "Unsetting \$x\n"; unset($x); echo "Finishing bar()\n"; } bar();

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.0090.00618.40
8.3.50.0140.00521.90
8.3.40.0120.00318.67
8.3.30.0150.00018.67
8.3.20.0040.00420.12
8.3.10.0050.00323.52
8.3.00.0080.00019.97
8.2.180.0110.00425.92
8.2.170.0040.01122.96
8.2.160.0100.00320.57
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0060.00319.27
8.2.120.0050.00326.35
8.2.110.0030.00719.30
8.2.100.0070.00418.04
8.2.90.0080.00019.02
8.2.80.0080.00017.97
8.2.70.0030.00517.50
8.2.60.0060.00317.91
8.2.50.0030.00618.09
8.2.40.0030.00521.18
8.2.30.0000.00820.69
8.2.20.0040.00417.75
8.2.10.0050.00218.07
8.2.00.0040.00417.98
8.1.280.0070.01425.92
8.1.270.0120.00320.43
8.1.260.0070.00028.09
8.1.250.0040.00428.09
8.1.240.0030.00622.53
8.1.230.0000.01117.70
8.1.220.0080.00017.76
8.1.210.0040.00418.77
8.1.200.0000.01017.35
8.1.190.0000.00917.23
8.1.180.0030.00618.10
8.1.170.0080.00018.56
8.1.160.0020.00520.82
8.1.150.0000.00718.84
8.1.140.0040.00419.57
8.1.130.0040.00417.75
8.1.120.0050.00217.49
8.1.110.0000.00717.43
8.1.100.0000.00817.47
8.1.90.0070.00017.46
8.1.80.0080.00017.49
8.1.70.0050.00317.38
8.1.60.0030.00617.47
8.1.50.0030.00617.54
8.1.40.0060.00317.57
8.1.30.0080.00017.66
8.1.20.0040.00417.67
8.1.10.0040.00417.50
8.1.00.0050.00317.39
8.0.300.0040.00418.77
8.0.290.0030.00616.75
8.0.280.0000.00718.45
8.0.270.0050.00217.29
8.0.260.0030.00317.18
8.0.250.0030.00316.90
8.0.240.0030.00316.92
8.0.230.0040.00417.09
8.0.220.0000.00716.87
8.0.210.0050.00316.91
8.0.200.0000.00717.07
8.0.190.0060.00316.96
8.0.180.0050.00217.03
8.0.170.0000.00916.95
8.0.160.0000.00717.00
8.0.150.0070.00017.00
8.0.140.0040.00416.84
8.0.130.0060.00013.39
8.0.120.0050.00316.77
8.0.110.0020.00516.93
8.0.100.0070.00016.89
8.0.90.0000.00716.85
8.0.80.0090.00916.84
8.0.70.0030.00516.87
8.0.60.0040.00417.04
8.0.50.0080.00016.96
8.0.30.0100.01016.92
8.0.20.0130.00717.41
8.0.10.0070.00017.04
8.0.00.0110.00816.67
7.4.330.0030.00316.77
7.4.320.0000.00716.63
7.4.300.0000.00616.50
7.4.290.0050.00216.50
7.4.280.0000.00916.45
7.4.270.0040.00416.58
7.4.260.0030.00616.60
7.4.250.0040.00416.47
7.4.240.0020.00516.54
7.4.230.0070.00016.50
7.4.220.0060.01516.64
7.4.210.0090.00616.55
7.4.200.0030.00316.63
7.4.150.0160.00317.40
7.4.140.0060.01217.86
7.4.130.0090.00916.55
7.4.120.0200.00316.45
7.4.110.0100.01016.47
7.4.100.0090.00916.59
7.4.90.0040.01316.56
7.4.80.0120.01219.39
7.4.70.0090.00616.67
7.4.60.0110.00616.61
7.4.50.0030.01016.65
7.4.40.0080.00816.68
7.4.30.0120.00616.58
7.4.10.0030.01314.60
7.4.00.0030.01314.99
7.3.330.0040.00413.16
7.3.320.0080.00013.25
7.3.310.0000.00716.15
7.3.300.0080.00016.38
7.3.290.0070.01016.32
7.3.280.0090.00716.36
7.3.270.0100.00717.40
7.3.260.0130.00316.49
7.3.240.0120.00516.51
7.3.230.0070.01016.48
7.3.210.0060.01216.49
7.3.200.0060.00916.54
7.3.190.0100.00716.50
7.3.180.0080.00816.40
7.3.170.0110.00616.40
7.3.160.0040.01116.63
7.3.130.0090.00914.76
7.3.120.0060.00914.86
7.3.110.0110.00714.83
7.3.100.0030.00914.89
7.3.90.0070.01014.89
7.3.80.0030.01014.61
7.3.70.0060.00314.80
7.3.60.0100.00714.64
7.3.50.0070.01014.74
7.3.40.0060.00314.62
7.3.30.0000.01614.85
7.3.20.0060.00816.52
7.3.10.0080.00616.48
7.3.00.0060.00816.54
7.2.330.0090.00916.68
7.2.320.0030.01516.42
7.2.310.0100.00716.75
7.2.300.0110.00816.64
7.2.290.0030.01316.70
7.2.260.0000.01915.23
7.2.250.0100.01015.31
7.2.240.0030.01015.09
7.2.230.0060.00915.02
7.2.220.0030.00615.19
7.2.210.0100.00315.34
7.2.200.0070.01114.95
7.2.190.0070.01014.79
7.2.180.0040.01114.83
7.2.170.0060.01614.83
7.2.160.0000.02214.95
7.2.150.0090.01316.70
7.2.140.0000.01516.89
7.2.130.0050.00916.81
7.2.120.0050.00916.93
7.2.110.0070.00316.88
7.2.100.0060.00816.71
7.2.90.0080.00517.07
7.2.80.0030.01216.97
7.2.70.0060.00617.00
7.2.60.0050.00916.76
7.2.50.0060.00816.67
7.2.40.0020.01016.89
7.2.30.0080.00516.86
7.2.20.0080.00616.81
7.2.10.0070.00716.88
7.2.00.0060.00917.62
7.1.330.0090.00315.66
7.1.320.0030.01015.56
7.1.310.0000.01315.63
7.1.300.0100.00315.61
7.1.290.0070.00715.73
7.1.280.0040.01515.43
7.1.270.0040.01315.90
7.1.260.0110.00315.80
7.1.250.0040.00715.61
7.1.240.0040.00715.62
7.1.230.0040.00915.63
7.1.220.0040.01115.73
7.1.210.0030.00715.91
7.1.200.0060.00515.79
7.1.190.0000.00915.61
7.1.180.0060.00615.77
7.1.170.0040.00815.75
7.1.160.0000.01215.51
7.1.150.0130.00315.82
7.1.140.0000.01915.85
7.1.130.0070.01315.47
7.1.120.0040.01115.92
7.1.110.0070.00715.29
7.1.100.0070.00616.87
7.1.90.0070.00415.85
7.1.80.0060.00315.77
7.1.70.0050.00516.29
7.1.60.0080.00917.19
7.1.50.0070.00516.36
7.1.40.0040.01115.75
7.1.30.0060.00615.64
7.1.20.0060.00615.52
7.1.10.0070.00715.35
7.1.00.0050.04018.88
7.0.330.0030.01015.08
7.0.320.0030.00915.21
7.0.310.0030.01215.21
7.0.300.0070.00715.30
7.0.290.0080.00415.46
7.0.280.0060.00615.41
7.0.270.0100.00015.50
7.0.260.0070.00715.39
7.0.250.0040.01215.29
7.0.240.0040.00715.39
7.0.230.0030.01015.23
7.0.220.0000.01415.45
7.0.210.0030.00915.43
7.0.200.0010.00815.92
7.0.190.0000.01515.41
7.0.180.0050.00315.32
7.0.170.0110.00015.17
7.0.160.0030.00915.30
7.0.150.0030.00915.39
7.0.140.0030.00615.20
7.0.130.0080.00415.49
7.0.120.0030.01015.52
7.0.110.0080.00315.09
7.0.100.0140.00315.47
7.0.90.0060.00615.43
7.0.80.0070.00715.20
7.0.70.0140.00015.11
7.0.60.0050.02517.56
7.0.50.0030.04816.57
7.0.40.0100.02016.83
7.0.30.0130.03316.72
7.0.20.0150.03916.83
7.0.10.0090.04116.95
7.0.00.0050.03916.78
5.6.400.0000.01214.15
5.6.390.0060.00914.08
5.6.380.0040.00714.32
5.6.370.0090.00313.99
5.6.360.0120.00014.46
5.6.350.0040.01114.14
5.6.340.0060.01014.18
5.6.330.0060.00814.13
5.6.320.0070.00714.31
5.6.310.0060.00313.86
5.6.300.0080.00813.95
5.6.290.0060.00913.82
5.6.280.0020.03917.62
5.6.270.0070.00714.17
5.6.260.0030.01313.95
5.6.250.0120.00314.17
5.6.240.0100.00714.31
5.6.230.0070.01014.24
5.6.220.0000.01814.00
5.6.210.0080.04517.46
5.6.200.0100.03916.16
5.6.190.0080.02117.20
5.6.180.1950.02817.20
5.6.170.0140.02517.10
5.6.160.0090.04417.40
5.6.150.0080.03315.94
5.6.140.0020.04816.04
5.6.130.0050.02616.21
5.6.120.0120.04217.42
5.6.110.0070.04117.48
5.6.100.0100.04117.40
5.6.90.0020.04617.54
5.6.80.0100.03817.24
5.6.70.0040.01113.95
5.6.60.0070.00714.04
5.6.50.0090.00313.90
5.6.40.0070.00714.05
5.6.30.0040.00714.14
5.6.20.0070.01013.96
5.6.10.0040.01114.13
5.6.00.0070.00314.00
5.5.380.0100.00714.14
5.5.370.0070.00414.00
5.5.360.0140.00013.68
5.5.350.0140.03817.31
5.5.340.0050.04516.03
5.5.330.0080.03417.09
5.5.320.0400.03317.19
5.5.310.0260.03817.15
5.5.300.0060.03216.03
5.5.290.0050.04716.10
5.5.280.0100.02117.47
5.5.270.0120.04217.39
5.5.260.0030.05017.41
5.5.250.0060.02317.09
5.5.240.0160.03817.18
5.5.230.0040.00813.96
5.5.220.0100.00313.81
5.5.210.0090.00013.66
5.5.200.0040.00713.88
5.5.190.0060.01013.97
5.5.180.0100.00313.90
5.5.170.0030.00613.95
5.5.160.0090.00313.85
5.5.150.0070.00713.95
5.5.140.0070.00714.08
5.5.130.0090.00913.89
5.5.120.0070.00613.91
5.5.110.0100.00314.13
5.5.100.0070.00414.23
5.5.90.0120.00613.72
5.5.80.0090.00013.87
5.5.70.0070.00314.02
5.5.60.0070.00413.82
5.5.50.0030.01013.86
5.5.40.0040.00813.93
5.5.30.0070.00414.01
5.5.20.0030.00614.09
5.5.10.0070.00413.54
5.5.00.0060.00613.90

preferences:
54.81 ms | 401 KiB | 5 Q