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() { $f = new FooBar; yield from $f; yield 3; } function bar() { echo "Starting bar()\n"; $x = foo(); try { var_dump($x->current()); } catch (Exception $e) { echo "Caught Exception\n"; } var_dump($x->current()); $x->next(); var_dump($x->current()); 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.0070.00716.50
8.3.50.0090.00617.98
8.3.40.0140.00418.83
8.3.30.0120.00318.79
8.3.20.0070.00020.34
8.3.10.0040.00423.47
8.3.00.0080.00020.09
8.2.180.0060.00918.42
8.2.170.0110.00422.96
8.2.160.0060.00920.44
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0000.00821.04
8.2.120.0040.00426.35
8.2.110.0000.00919.13
8.2.100.0090.00317.59
8.2.90.0000.00819.11
8.2.80.0030.00517.97
8.2.70.0040.00417.50
8.2.60.0000.00817.68
8.2.50.0050.00318.07
8.2.40.0080.00021.25
8.2.30.0070.00420.36
8.2.20.0000.00817.82
8.2.10.0030.00517.97
8.2.00.0090.00017.94
8.1.280.0130.00625.92
8.1.270.0070.01420.09
8.1.260.0080.00028.09
8.1.250.0080.00028.09
8.1.240.0080.00022.14
8.1.230.0080.00418.74
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00717.35
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0080.00018.49
8.1.160.0040.00420.68
8.1.150.0030.00518.93
8.1.140.0000.00819.48
8.1.130.0040.00417.75
8.1.120.0000.00717.44
8.1.110.0040.00417.37
8.1.100.0000.00817.42
8.1.90.0040.00417.44
8.1.80.0030.00517.38
8.1.70.0030.00317.43
8.1.60.0030.00617.50
8.1.50.0040.00417.51
8.1.40.0030.00517.46
8.1.30.0040.00417.54
8.1.20.0000.00817.55
8.1.10.0000.00717.56
8.1.00.0040.00417.50
8.0.300.0050.00218.77
8.0.290.0000.00816.63
8.0.280.0000.00718.45
8.0.270.0030.00517.18
8.0.260.0030.00317.30
8.0.250.0030.00317.00
8.0.240.0030.00317.00
8.0.230.0030.00316.91
8.0.220.0000.00717.00
8.0.210.0040.00416.98
8.0.200.0070.00017.02
8.0.190.0080.00016.93
8.0.180.0030.00317.00
8.0.170.0040.00416.89
8.0.160.0070.00017.03
8.0.150.0000.00716.87
8.0.140.0080.00016.83
8.0.130.0050.00013.42
8.0.120.0040.00416.82
8.0.110.0080.00017.00
8.0.100.0070.00017.02
8.0.90.0070.00017.00
8.0.80.0090.00716.96
8.0.70.0000.00716.91
8.0.60.0070.00017.02
8.0.50.0000.00716.89
8.0.30.0050.01717.24
8.0.20.0130.00517.40
8.0.10.0040.00416.88
8.0.00.0090.00816.93
7.4.330.0060.00016.84
7.4.320.0000.00716.41
7.4.300.0030.00316.36
7.4.290.0030.00316.58
7.4.280.0030.00616.61
7.4.270.0030.00316.66
7.4.260.0000.00916.52
7.4.250.0040.00416.53
7.4.240.0040.00416.59
7.4.230.0000.00716.34
7.4.220.0180.01116.61
7.4.210.0120.00316.63
7.4.200.0030.00416.26
7.4.160.0000.01716.41
7.4.150.0150.00317.40
7.4.140.0120.00617.86
7.4.130.0150.01016.56
7.4.120.0140.00516.55
7.4.110.0120.00616.49
7.4.100.0080.00916.69
7.4.90.0110.00716.61
7.4.80.0120.00619.39
7.4.70.0060.00916.54
7.4.60.0090.00916.52
7.4.50.0070.00716.58
7.4.40.0040.01116.57
7.4.30.0150.00816.52
7.4.10.0030.01214.88
7.4.00.0060.01114.99
7.3.330.0000.00713.33
7.3.320.0000.00613.38
7.3.310.0030.00316.48
7.3.300.0000.00716.29
7.3.290.0060.00816.39
7.3.280.0040.01316.35
7.3.270.0180.00017.40
7.3.260.0040.01416.43
7.3.250.0080.01216.51
7.3.240.0080.00916.31
7.3.230.0000.01716.55
7.3.210.0110.00616.56
7.3.200.0060.01016.25
7.3.190.0090.00916.59
7.3.180.0090.00616.36
7.3.170.0090.00916.60
7.3.160.0050.01016.45
7.3.130.0050.01214.81
7.3.120.0060.01214.76
7.3.110.0070.01214.86
7.3.100.0060.00614.74
7.3.90.0080.00814.92
7.3.80.0070.00714.82
7.3.70.0050.01014.87
7.3.60.0040.00914.86
7.3.50.0080.00614.76
7.3.40.0040.01114.76
7.3.30.0060.00514.92
7.3.20.0040.00716.66
7.3.10.0050.00516.54
7.3.00.0090.00516.70
7.2.330.0160.00316.77
7.2.320.0170.00016.74
7.2.310.0060.01116.37
7.2.300.0070.01016.78
7.2.290.0070.01116.68
7.2.260.0100.00815.02
7.2.250.0070.01015.15
7.2.240.0030.01115.11
7.2.230.0060.00815.09
7.2.220.0050.00815.22
7.2.210.0040.01015.21
7.2.200.0100.00614.89
7.2.190.0080.00614.99
7.2.180.0060.00515.15
7.2.170.0090.00615.01
7.2.160.0050.00915.10
7.2.150.0050.00616.80
7.2.140.0050.00616.95
7.2.130.0060.00816.71
7.2.120.0040.00916.76
7.2.110.0040.00916.78
7.2.100.0080.00716.77
7.2.90.0090.00416.84
7.2.80.0060.01016.80
7.2.70.0050.00816.79
7.2.60.0060.00816.73
7.2.50.0090.00816.75
7.2.40.0060.00816.67
7.2.30.0060.00816.85
7.2.20.0080.00616.70
7.2.10.0090.00516.71
7.2.00.0050.01217.39
7.1.330.0030.01015.60
7.1.320.0060.00915.74
7.1.310.0070.00615.63
7.1.300.0050.01015.61
7.1.290.0040.01015.67
7.1.280.0020.00915.79
7.1.270.0020.00715.69
7.1.260.0040.00715.72
7.1.250.0090.00615.50
7.1.240.0070.00415.66
7.1.230.0060.00715.75
7.1.220.0050.00915.70
7.1.210.0040.00615.81
7.1.200.0030.01115.78
7.1.190.0020.01315.70
7.1.180.0070.00415.67
7.1.170.0080.00715.75
7.1.160.0040.01015.63
7.1.150.0030.00915.77
7.1.140.0070.00715.73
7.1.130.0060.00815.81
7.1.120.0050.00615.86
7.1.110.0060.00615.74
7.1.100.0050.00916.16
7.1.90.0040.00715.77
7.1.80.0020.01015.73
7.1.70.0070.00516.17
7.1.60.0070.01016.61
7.1.50.0060.00715.85
7.1.40.0050.00715.90
7.1.30.0030.01015.67
7.1.20.0060.00515.77
7.1.10.0070.00715.73
7.1.00.0040.02417.45
7.0.330.0040.00715.25
7.0.320.0060.00615.42
7.0.310.0060.00815.19
7.0.300.0070.00715.42
7.0.290.0060.00615.28
7.0.280.0050.00715.31
7.0.270.0040.01015.36
7.0.260.0020.01015.19
7.0.250.0040.00615.45
7.0.240.0070.00415.37
7.0.230.0060.00915.47
7.0.220.0030.00815.24
7.0.210.0090.00615.48
7.0.200.0070.00415.69
7.0.190.0050.01015.20
7.0.180.0050.00815.48
7.0.170.0020.01115.47
7.0.160.0070.00615.39
7.0.150.0080.00615.35
7.0.140.0040.00915.39
7.0.130.0070.00615.28
7.0.120.0060.00715.34
7.0.110.0090.00615.36
7.0.100.0040.00815.26
7.0.90.0050.00515.29
7.0.80.0060.00715.33
7.0.70.0070.00615.47
7.0.60.0050.02016.56
7.0.50.0030.02316.04
7.0.40.0060.01415.13
7.0.30.0080.02414.99
7.0.20.0120.02215.04
7.0.10.0060.02715.13
7.0.00.0080.02215.13
5.6.400.0060.00514.11
5.6.390.0050.00814.21
5.6.380.0020.00714.22
5.6.370.0070.00614.09
5.6.360.0060.00514.21
5.6.350.0050.01013.97
5.6.340.0060.01014.23
5.6.330.0030.01014.05
5.6.320.0030.00914.15
5.6.310.0060.00514.05
5.6.300.0050.00814.19
5.6.290.0050.00514.16
5.6.280.0070.02215.74
5.6.270.0040.01114.13
5.6.260.0060.00814.13
5.6.250.0030.00814.01
5.6.240.0020.01014.16
5.6.230.0090.00514.04
5.6.220.0040.00914.12
5.6.210.0080.02415.64
5.6.200.0040.02415.19
5.6.190.0020.01815.72
5.6.180.0930.01615.72
5.6.170.0090.01515.63
5.6.160.0090.02015.67
5.6.150.0060.02414.96
5.6.140.0060.01615.03
5.6.130.0060.01715.17
5.6.120.0070.01315.77
5.6.110.0030.02115.75
5.6.100.0070.02715.79
5.6.90.0070.01715.84
5.6.80.0040.02615.63
5.6.70.0060.00714.03
5.6.60.0060.00514.03
5.6.50.0110.00314.09
5.6.40.0060.00814.08
5.6.30.0070.00414.06
5.6.20.0060.00714.00
5.6.10.0040.00714.12
5.6.00.0050.00713.95
5.5.380.0060.00913.91
5.5.370.0040.00913.85
5.5.360.0070.00413.97
5.5.350.0060.02515.85
5.5.340.0050.02415.09
5.5.330.0090.01415.56
5.5.320.0110.02515.64
5.5.310.0120.02115.64
5.5.300.0070.01515.02
5.5.290.0060.02615.09
5.5.280.0040.01515.67
5.5.270.0050.02415.71
5.5.260.0070.02115.60
5.5.250.0060.01615.61
5.5.240.0110.02315.41
5.5.230.0010.01013.98
5.5.220.0060.00714.00
5.5.210.0050.00813.91
5.5.200.0080.00513.99
5.5.190.0040.01014.09
5.5.180.0050.00613.97
5.5.170.0060.00813.81
5.5.160.0050.00713.72
5.5.150.0050.00913.99
5.5.140.0080.00614.05
5.5.130.0020.01013.86
5.5.120.0030.00814.01
5.5.110.0060.00414.06
5.5.100.0050.00614.02
5.5.90.0060.00613.92
5.5.80.0090.00313.80
5.5.70.0050.00914.00
5.5.60.0070.00613.89
5.5.50.0040.00913.99
5.5.40.0090.00313.92
5.5.30.0050.00913.84
5.5.20.0030.00913.97
5.5.10.0050.00913.95
5.5.00.0040.00813.84

preferences:
63.94 ms | 400 KiB | 5 Q