3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen() { yield 0; yield ['a','b','c'][1]; yield 2; yield 3; yield $element = array('tom','dick','sally','sue')[2]; } try { $o = gen(); foreach($o as $g) { echo $g,' '; echo empty(boolval($g))? 'false' : 'true'; echo "\n"; } } catch (Exception $e) { echo "caught exception"; } finally { echo "Whatever, this line will always run\n"; } $names = array(array("Rasmus","Lerdorf"), array("Andi","Gutmans"),array("Zeev","Suraski")); foreach ($names as list($fname,$lname)) { echo $fname, "\n"; }

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.75
8.3.50.0200.00922.18
8.3.40.0140.00018.95
8.3.30.0080.00819.26
8.3.20.0080.00020.19
8.3.10.0080.00023.66
8.3.00.0080.00022.34
8.2.180.0110.01118.30
8.2.170.0140.00322.96
8.2.160.0130.00020.33
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00022.29
8.2.110.0060.00322.16
8.2.100.0070.00717.84
8.2.90.0000.00819.15
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0030.00517.68
8.2.50.0030.00618.07
8.2.40.0040.00419.38
8.2.30.0040.00418.04
8.2.20.0090.00017.83
8.2.10.0070.00017.72
8.2.00.0070.00017.88
8.1.280.0140.00325.92
8.1.270.0040.00423.96
8.1.260.0030.00626.35
8.1.250.0000.00728.09
8.1.240.0030.00623.96
8.1.230.0040.00719.01
8.1.220.0030.00517.74
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0040.00417.53
8.1.180.0030.00518.10
8.1.170.0000.00818.59
8.1.160.0030.00622.01
8.1.150.0030.00618.55
8.1.140.0000.00717.41
8.1.130.0070.00017.77
8.1.120.0050.00317.55
8.1.110.0000.00817.39
8.1.100.0070.00017.43
8.1.90.0030.00417.37
8.1.80.0000.00717.44
8.1.70.0000.00717.42
8.1.60.0040.00417.56
8.1.50.0040.00417.48
8.1.40.0030.00517.42
8.1.30.0080.00017.69
8.1.20.0040.00417.68
8.1.10.0000.00717.62
8.1.00.0040.00417.52
8.0.300.0040.00418.77
8.0.290.0030.00617.05
8.0.280.0070.00018.45
8.0.270.0000.00717.20
8.0.260.0030.00316.76
8.0.250.0070.00017.04
8.0.240.0030.00517.02
8.0.230.0040.00416.97
8.0.220.0000.00716.98
8.0.210.0000.00716.95
8.0.200.0030.00317.03
8.0.190.0040.00416.93
8.0.180.0070.00017.00
8.0.170.0050.00317.01
8.0.160.0050.00216.95
8.0.150.0070.00016.94
8.0.140.0040.00416.94
8.0.130.0050.00013.30
8.0.120.0080.00016.82
8.0.110.0000.00716.96
8.0.100.0000.00716.82
8.0.90.0040.00417.02
8.0.80.0060.00916.91
8.0.70.0050.00316.96
8.0.60.0000.00816.91
8.0.50.0030.00516.94
8.0.30.0110.00817.20
8.0.20.0100.00817.40
8.0.10.0040.00417.14
8.0.00.0090.01016.79
7.4.330.0020.00315.00
7.4.320.0030.00316.57
7.4.300.0060.00016.56
7.4.290.0000.00716.61
7.4.280.0040.00416.60
7.4.270.0030.00316.64
7.4.260.0040.00416.53
7.4.250.0040.00416.48
7.4.240.0020.00516.59
7.4.230.0070.00016.39
7.4.220.0000.01816.43
7.4.210.0050.01216.61
7.4.200.0030.00316.50
7.4.190.0040.00416.78
7.4.160.0060.00916.53
7.4.150.0110.00617.40
7.4.140.0060.01117.86
7.4.130.0090.00916.60
7.4.120.0110.00916.50
7.4.110.0040.01316.63
7.4.100.0090.01216.63
7.4.90.0070.01016.67
7.4.80.0060.01519.39
7.4.70.0090.00916.49
7.4.60.0030.01316.31
7.4.50.0040.00416.38
7.4.40.0030.00922.77
7.4.30.0040.01516.57
7.4.00.0100.00714.73
7.3.330.0000.00513.15
7.3.320.0050.00013.18
7.3.310.0040.00416.43
7.3.300.0000.00716.23
7.3.290.0140.00016.44
7.3.280.0080.00816.37
7.3.270.0070.01017.40
7.3.260.0100.01016.49
7.3.250.0160.00616.38
7.3.240.0130.00316.64
7.3.230.0090.00616.58
7.3.210.0100.00716.39
7.3.200.0100.00719.39
7.3.190.0150.00616.30
7.3.180.0040.01116.64
7.3.170.0130.00316.50
7.3.160.0110.00416.39
7.3.120.0090.00614.60
7.3.10.0060.00616.75
7.3.00.0100.00516.53
7.2.330.0030.01616.72
7.2.320.0080.01016.64
7.2.310.0070.01116.56
7.2.300.0090.01216.82
7.2.290.0130.00316.55
7.2.130.0050.01217.00
7.2.120.0030.00716.78
7.2.110.0080.00616.76
7.2.100.0070.00816.67
7.2.90.0070.00717.01
7.2.80.0070.00716.81
7.2.70.0060.00716.95
7.2.60.0080.00616.76
7.2.50.0100.00516.81
7.2.40.0070.00516.69
7.2.30.0040.01316.82
7.2.20.0090.00616.94
7.2.10.0130.00216.82
7.2.00.0060.01317.59
7.1.250.0060.00815.42
7.1.240.0070.00715.81
7.1.230.0060.00615.80
7.1.220.0070.00415.64
7.1.210.0070.00415.74
7.1.200.0110.00515.88
7.1.190.0040.00815.83
7.1.180.0140.00015.94
7.1.170.0120.00315.87
7.1.160.0090.00615.80
7.1.150.0040.01115.90
7.1.140.0030.01015.82
7.1.130.0080.00615.98
7.1.120.0090.00315.86
7.1.110.0080.00415.72
7.1.100.0080.00616.88
7.1.90.0000.01015.74
7.1.80.0110.00415.70
7.1.70.0060.00616.47
7.1.60.0130.00817.51
7.1.50.0090.00816.21
7.1.40.0120.00015.74
7.1.30.0080.00815.67
7.1.20.0070.00315.87
7.1.10.0120.00015.58
7.1.00.0110.03619.21
7.0.330.0100.00315.05
7.0.320.0120.00415.13
7.0.310.0030.01215.42
7.0.300.0030.01115.54
7.0.290.0120.00315.32
7.0.280.0130.00015.25
7.0.270.0070.00315.35
7.0.260.0100.00015.10
7.0.250.0110.00415.43
7.0.240.0030.01214.98
7.0.230.0120.00615.17
7.0.220.0040.00815.13
7.0.210.0080.00515.07
7.0.200.0060.00416.15
7.0.190.0080.00415.30
7.0.180.0060.00915.37
7.0.170.0040.00815.54
7.0.160.0100.00715.52
7.0.150.0070.00715.28
7.0.140.0080.03818.87
7.0.130.0080.00815.26
7.0.120.0000.01315.65
7.0.110.0090.00315.30
7.0.100.0040.01115.40
7.0.90.0080.00315.24
7.0.80.0070.00715.20
7.0.70.0070.00715.24
7.0.60.0150.03717.73
7.0.50.0060.02316.51
7.0.40.0070.04016.64
7.0.30.0160.04216.61
7.0.20.0230.03716.77
7.0.10.0040.03716.54
7.0.00.0070.04216.79
5.6.380.0100.00014.03
5.6.370.0090.00614.32
5.6.360.0040.00914.52
5.6.350.0040.00814.51
5.6.340.0100.00014.11
5.6.330.0000.01214.55
5.6.320.0060.00614.31
5.6.310.0050.00314.59
5.6.300.0100.00014.24
5.6.290.0000.01014.35
5.6.280.0070.03817.78
5.6.270.0030.00814.32
5.6.260.0000.01314.59
5.6.250.0090.00314.40
5.6.240.0080.00314.39
5.6.230.0070.00314.38
5.6.220.0060.00614.26
5.6.210.0030.04717.52
5.6.200.0110.03816.36
5.6.190.0020.04317.48
5.6.180.0150.04017.51
5.6.170.0170.03517.43
5.6.160.0070.04217.45
5.6.150.0030.03916.22
5.6.140.0070.03016.29
5.6.130.0050.03216.41
5.6.120.0050.02317.51
5.6.110.0130.03817.62
5.6.100.0030.03817.63
5.6.90.0040.03517.52
5.6.80.0070.03717.33
5.6.70.0040.00713.96
5.6.60.0060.00614.33
5.6.50.0070.00413.71
5.6.40.0040.00714.13
5.6.30.0040.00714.00
5.6.20.0040.00913.89
5.6.10.0040.00813.99
5.6.00.0030.00614.18
5.5.380.0100.00011.03
5.5.370.0040.00411.25
5.5.360.0030.00310.84
5.5.350.2140.02015.82
5.5.340.0050.04314.56
5.5.330.0050.03015.59
5.5.320.0310.01815.91
5.5.310.0140.04115.57
5.5.300.0070.03414.49
5.5.290.0020.02414.53
5.5.280.0070.02815.96
5.5.270.0080.04415.85
5.5.260.0080.03715.88
5.5.250.0050.04015.79
5.5.240.0160.03315.74
5.5.230.0030.00311.16
5.5.220.0060.00310.84
5.5.210.0040.00411.21
5.5.200.0040.00811.29
5.5.190.0060.00310.93
5.5.180.0090.00011.24
5.5.170.0040.00411.14
5.5.160.0110.00010.87
5.5.150.0050.00511.17
5.5.140.0030.00710.71
5.5.130.0060.00610.91
5.5.120.0050.00310.83
5.5.110.0080.00310.96
5.5.100.0000.01310.71
5.5.90.0080.00011.11
5.5.80.0030.00611.29
5.5.70.0030.00911.04
5.5.60.0000.01011.31
5.5.50.0050.00311.18
5.5.40.0030.00611.07
5.5.30.0040.00811.20
5.5.20.0000.01411.31
5.5.10.0030.00611.01
5.5.00.0030.01011.13
5.4.450.2100.02315.08
5.4.440.1650.02515.14
5.4.430.2060.01915.11
5.4.420.1800.02215.01
5.4.410.1750.02215.16
5.4.400.1890.01814.96
5.4.390.1870.02314.99
5.4.380.2160.01814.96
5.4.370.1780.02014.87
5.4.360.2320.02115.06
5.4.350.1320.02514.95
5.4.340.1320.01915.11
5.4.330.0050.00510.85
5.4.320.1620.02314.82
5.4.310.0860.02015.06
5.4.300.1270.01914.88
5.4.290.1570.01815.12
5.4.280.1730.02514.88
5.4.270.1780.01814.99
5.4.260.1970.02514.82
5.4.250.1850.02514.77
5.4.240.1630.02315.09
5.4.230.1730.02314.87
5.4.220.2080.02314.93
5.4.210.1970.02715.04
5.4.200.1580.02014.94
5.4.190.1600.02214.89
5.4.180.1700.02314.94
5.4.170.1700.01814.95
5.4.160.1530.02314.65
5.4.150.1640.02214.92
5.4.140.1840.02413.50
5.4.130.1660.02013.57
5.4.120.1620.02013.73
5.4.110.1850.02013.61
5.4.100.1600.01913.66
5.4.90.1760.02113.71
5.4.80.1830.02213.41
5.4.70.1630.02013.54
5.4.60.1720.02213.72
5.4.50.1780.01813.58
5.4.40.1620.02513.73
5.4.30.1670.02113.59
5.4.20.0050.02213.68
5.4.10.0640.02813.55
5.4.00.1570.02313.25
5.3.290.1680.02312.56
5.3.280.1850.02112.44
5.3.270.1650.02012.39
5.3.260.1810.02112.29
5.3.250.1820.02012.38
5.3.240.1770.01812.41
5.3.230.1880.01712.45
5.3.220.1780.02312.42
5.3.210.1810.02412.33
5.3.200.1580.02412.34
5.3.190.1740.01712.40
5.3.180.1860.02012.34
5.3.170.1460.02312.55
5.3.160.1530.02112.53
5.3.150.1580.02212.35
5.3.140.1820.02312.44
5.3.130.1830.01812.35
5.3.120.0180.03512.49
5.3.110.0080.02012.35
5.3.100.1700.02512.21
5.3.90.1650.02212.35
5.3.80.1600.02312.19
5.3.70.1930.01612.14
5.3.60.1670.01812.16
5.3.50.1850.01711.97
5.3.40.1610.02012.04
5.3.30.2060.02012.03
5.3.20.1880.02011.96
5.3.10.1850.02311.87
5.3.00.1830.02011.86
5.2.170.1360.01510.56
5.2.160.1370.02010.71
5.2.150.1380.01610.68
5.2.140.1580.02110.71
5.2.130.1630.01810.66
5.2.120.1930.01810.69
5.2.110.1340.01710.56
5.2.100.1520.01610.56
5.2.90.1500.01710.69
5.2.80.1560.01510.62
5.2.70.0830.01810.56
5.2.60.0050.03310.54
5.2.50.0030.01810.49
5.2.40.0050.03210.49
5.2.30.1020.01810.63
5.2.20.1380.01510.47
5.2.10.1090.01910.44
5.2.00.1370.01810.34
5.1.60.1500.01410.10
5.1.50.1370.0149.99
5.1.40.1420.01410.01
5.1.30.1330.01810.16
5.1.20.1500.01510.29
5.1.10.1530.01310.18
5.1.00.1320.01610.03
5.0.50.0900.0129.66
5.0.40.0670.0139.67
5.0.30.0880.0209.67
5.0.20.0860.0119.68
5.0.10.0740.0089.68
5.0.00.0890.0149.68
4.4.90.0050.0189.63
4.4.80.0020.0089.63
4.4.70.0670.0109.64
4.4.60.0470.0099.64
4.4.50.0620.0159.64
4.4.40.0750.0149.64
4.4.30.0880.0089.64
4.4.20.0820.0109.65
4.4.10.0830.0119.66
4.4.00.0710.0129.66
4.3.110.0850.0089.67
4.3.100.0890.0079.67
4.3.90.0680.0109.68
4.3.80.0820.0169.69
4.3.70.0750.0089.69
4.3.60.0700.0089.69
4.3.50.0660.0109.69
4.3.40.0630.0279.69
4.3.30.0450.0159.69
4.3.20.0450.0119.70
4.3.10.0350.0109.70
4.3.00.0470.0059.70

preferences:
39.65 ms | 401 KiB | 5 Q