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() { yield 1; try { $f = new FooBar; yield from $f; } catch (Exception $e) { echo "[foo()] Caught Exception\n"; } } function bar() { echo "Starting bar()\n"; $x = foo(); var_dump($x->current()); $x->next(); try { var_dump($x->current()); } catch (Exception $e) { echo "[bar()] 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.70.0090.00618.43
8.3.60.0060.00916.50
8.3.50.0110.00622.12
8.3.40.0090.00618.88
8.3.30.0060.01518.66
8.3.20.0050.00320.16
8.3.10.0080.00023.65
8.3.00.0040.00419.79
8.2.180.0040.01118.29
8.2.170.0110.00422.96
8.2.160.0040.01120.39
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0090.00021.00
8.2.120.0040.00426.35
8.2.110.0060.00320.48
8.2.100.0000.01217.93
8.2.90.0050.00319.17
8.2.80.0040.00417.97
8.2.70.0060.00317.75
8.2.60.0000.00818.04
8.2.50.0040.00418.07
8.2.40.0030.00621.01
8.2.30.0060.00320.51
8.2.20.0000.00717.82
8.2.10.0080.00017.98
8.2.00.0090.00017.98
8.1.280.0120.00325.92
8.1.270.0000.00820.24
8.1.260.0070.00028.09
8.1.250.0080.00028.09
8.1.240.0090.00022.10
8.1.230.0040.00717.71
8.1.220.0040.00417.78
8.1.210.0060.00318.77
8.1.200.0030.00717.47
8.1.190.0060.00317.23
8.1.180.0040.00418.10
8.1.170.0030.00618.46
8.1.160.0000.00720.75
8.1.150.0040.00418.89
8.1.140.0080.00019.46
8.1.130.0000.00817.75
8.1.120.0040.00417.50
8.1.110.0040.00417.43
8.1.100.0080.00017.48
8.1.90.0040.00417.36
8.1.80.0030.00617.34
8.1.70.0080.00017.43
8.1.60.0050.00317.59
8.1.50.0040.00417.51
8.1.40.0000.00817.57
8.1.30.0000.00817.55
8.1.20.0040.00417.62
8.1.10.0030.00617.46
8.1.00.0040.00417.46
8.0.300.0020.00518.77
8.0.290.0040.00416.88
8.0.280.0000.00718.46
8.0.270.0030.00317.27
8.0.260.0030.00317.27
8.0.250.0040.00416.98
8.0.240.0030.00317.10
8.0.230.0030.00317.04
8.0.220.0000.00716.92
8.0.210.0080.00016.98
8.0.200.0030.00316.99
8.0.190.0030.00516.91
8.0.180.0040.00416.83
8.0.170.0030.00617.04
8.0.160.0030.00516.97
8.0.150.0000.00716.87
8.0.140.0040.00416.79
8.0.130.0030.00313.44
8.0.120.0040.00416.89
8.0.110.0030.00516.94
8.0.100.0000.00716.92
8.0.90.0000.00716.99
8.0.80.0080.00816.87
8.0.70.0080.00016.91
8.0.60.0000.00716.85
8.0.50.0050.00316.84
8.0.30.0060.01417.21
8.0.20.0130.00717.40
8.0.10.0050.00317.12
8.0.00.0110.00816.71
7.4.330.0020.00216.79
7.4.320.0000.00716.53
7.4.300.0060.00016.64
7.4.290.0060.00316.48
7.4.280.0030.00616.65
7.4.270.0030.00316.62
7.4.260.0040.00416.52
7.4.250.0000.00916.58
7.4.240.0040.00416.47
7.4.230.0000.00716.64
7.4.220.0070.01116.64
7.4.210.0070.00716.57
7.4.200.0070.00016.31
7.4.160.0060.01016.54
7.4.150.0160.00317.40
7.4.140.0090.01217.86
7.4.130.0060.01116.56
7.4.120.0070.01116.42
7.4.110.0090.00916.41
7.4.100.0090.00916.39
7.4.90.0130.00716.59
7.4.80.0140.00619.39
7.4.70.0110.00616.53
7.4.60.0130.00316.44
7.4.50.0070.00716.35
7.4.40.0110.00716.47
7.4.30.0180.00616.60
7.4.00.0070.00814.86
7.3.330.0000.00713.23
7.3.320.0000.00713.23
7.3.310.0000.00716.37
7.3.300.0050.00316.31
7.3.290.0070.00916.36
7.3.280.0060.01216.35
7.3.270.0170.00717.40
7.3.260.0130.00316.44
7.3.240.0060.01116.40
7.3.230.0050.01116.57
7.3.210.0060.01216.42
7.3.200.0040.01716.28
7.3.190.0090.00916.47
7.3.180.0030.01216.49
7.3.170.0030.01416.39
7.3.160.0160.00016.60
7.3.120.0090.00914.54
7.3.110.0040.01514.88
7.3.100.0060.00914.95
7.3.90.0120.00614.97
7.3.80.0000.01014.72
7.3.70.0100.00314.86
7.3.60.0070.00314.93
7.3.50.0030.01014.94
7.3.40.0070.00714.86
7.3.30.0030.01014.63
7.3.20.0040.01216.80
7.3.10.0070.00716.79
7.3.00.0070.00416.64
7.2.330.0130.00616.77
7.2.320.0170.00716.83
7.2.310.0130.01016.90
7.2.300.0060.00916.77
7.2.290.0070.01016.72
7.2.250.0140.00715.13
7.2.240.0070.01415.14
7.2.230.0100.00315.30
7.2.220.0100.00715.20
7.2.210.0120.00414.93
7.2.200.0060.00915.06
7.2.190.0060.00915.05
7.2.180.0090.00315.16
7.2.170.0000.00915.24
7.2.60.0060.00616.75
7.2.00.0060.00319.21
7.1.330.0090.00615.63
7.1.320.0070.01015.91
7.1.310.0100.00315.77
7.1.300.0040.00815.77
7.1.290.0130.00015.93
7.1.280.0030.01015.61
7.1.270.0030.00615.93
7.1.260.0060.00615.74
7.1.200.0000.01515.56
7.1.100.0030.00618.27
7.1.70.0040.00717.13
7.1.60.0030.02019.05
7.1.50.0130.00916.65
7.1.00.0030.07322.33
7.0.200.0050.00516.77
7.0.60.0170.07020.04
7.0.50.0070.06317.93
7.0.40.0070.04020.21
7.0.30.0300.03720.15
7.0.20.0270.05020.26
7.0.10.0070.07020.07
7.0.00.0030.08020.05
5.6.280.0070.06721.00
5.6.210.0130.07020.75
5.6.200.0000.06018.16
5.6.190.0070.04020.60
5.6.180.3130.04020.64
5.6.170.0230.07720.47
5.6.160.0130.07720.54
5.6.150.0070.04318.23
5.6.140.0100.05318.15
5.6.130.0000.04318.14
5.6.120.0130.07721.09
5.6.110.0030.04720.95
5.6.100.0100.04320.98
5.6.90.0030.07021.11
5.6.80.0100.07720.50
5.5.350.0170.08020.38
5.5.340.0130.07318.07
5.5.330.0030.04320.41
5.5.320.0470.08320.42
5.5.310.0330.06720.37
5.5.300.0130.07318.03
5.5.290.0030.08717.97
5.5.280.0100.04020.69
5.5.270.0170.07720.87
5.5.260.0130.06320.80
5.5.250.0030.04020.76
5.5.240.0200.05320.03

preferences:
85.8 ms | 401 KiB | 5 Q