3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $testdata = []; public function __construct(&$inputdata) { $this->testdata =& $inputdata; } public function &getIterator() { foreach ($this->testdata as $ikey => &$ivalue) { yield $ikey => $ivalue; } } } $data = array("one" => "Curly", "two" => "Larry", "three" => "Moe"); $t = new Test($data); foreach ($t->getIterator() as $tkey => &$tvalue) { // $tvalue -> $ivalue -> $t->testdata -> $inputdata -> $data // break any reference in that chain and the line below will not work $tvalue = strtoupper($tvalue); } foreach ($data as $dkey => $dvalue) { printf("%s: %s\n", $dkey, $dvalue); }

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.06
8.3.50.0040.01116.63
8.3.40.0070.01018.75
8.3.30.0040.01118.61
8.3.20.0000.00720.30
8.3.10.0080.00022.13
8.3.00.0070.01120.77
8.2.180.0000.01425.92
8.2.170.0090.00918.84
8.2.160.0070.01322.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0070.00021.00
8.2.110.0000.01022.27
8.2.100.0080.00417.78
8.2.90.0040.00417.63
8.2.80.0060.00318.73
8.2.70.0050.00317.63
8.2.60.0050.00317.63
8.2.50.0000.00817.63
8.2.40.0060.00319.35
8.2.30.0040.00419.13
8.2.20.0040.00418.13
8.2.10.0070.00018.11
8.2.00.0000.00818.04
8.1.280.0120.00325.92
8.1.270.0120.00324.66
8.1.260.0000.00926.35
8.1.250.0040.00428.09
8.1.240.0060.00621.95
8.1.230.0110.00022.11
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0000.00817.62
8.1.160.0040.00418.80
8.1.150.0040.00422.05
8.1.140.0000.00719.64
8.1.130.0070.00018.88
8.1.120.0000.00717.44
8.1.110.0040.00417.46
8.1.100.0040.00417.46
8.1.90.0000.00717.50
8.1.80.0000.01017.29
8.1.70.0070.00017.31
8.1.60.0040.00417.60
8.1.50.0000.00817.43
8.1.40.0040.00417.35
8.1.30.0030.00517.48
8.1.20.0000.00817.51
8.1.10.0050.00217.45
8.1.00.0000.00717.37
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0050.00518.45
8.0.270.0050.00317.20
8.0.260.0000.00618.82
8.0.250.0030.00316.98
8.0.240.0050.00317.00
8.0.230.0000.00716.84
8.0.220.0030.00316.75
8.0.210.0070.00016.91
8.0.200.0030.00316.98
8.0.190.0060.00316.85
8.0.180.0030.00616.92
8.0.170.0000.00716.80
8.0.160.0030.00516.98
8.0.150.0000.00716.82
8.0.140.0000.00816.70
8.0.130.0000.00613.29
8.0.120.0050.00216.82
8.0.110.0030.00516.90
8.0.100.0040.00416.89
8.0.90.0000.00716.80
8.0.80.0070.01416.90
8.0.70.0060.00316.78
8.0.60.0040.00416.93
8.0.50.0000.00816.92
8.0.30.0090.01017.05
8.0.20.0120.00717.40
8.0.10.0040.00417.04
8.0.00.0110.00816.62
7.4.330.0020.00215.55
7.4.320.0030.00316.56
7.4.300.0070.00016.52
7.4.290.0040.00416.59
7.4.280.0040.00416.54
7.4.270.0000.00716.43
7.4.260.0030.00316.54
7.4.250.0000.00716.53
7.4.240.0050.00216.46
7.4.230.0000.00716.55
7.4.220.0080.01316.43
7.4.210.0050.00816.59
7.4.200.0040.00416.35
7.4.160.0100.00716.53
7.4.150.0080.00917.40
7.4.140.0070.01017.86
7.4.130.0090.01216.44
7.4.120.0130.00916.65
7.4.110.0040.01316.35
7.4.100.0060.01916.37
7.4.90.0090.00816.59
7.4.80.0150.00619.39
7.4.70.0100.00716.25
7.4.60.0070.01016.53
7.4.50.0020.01216.31
7.4.40.0030.01316.48
7.4.30.0100.01316.32
7.4.00.0100.00615.14
7.3.330.0050.00013.21
7.3.320.0000.00513.14
7.3.310.0040.00416.38
7.3.300.0030.00316.37
7.3.290.0030.00316.32
7.3.280.0080.00716.35
7.3.270.0090.00917.40
7.3.260.0150.00516.33
7.3.250.0120.00616.56
7.3.240.0080.01216.41
7.3.230.0110.00716.29
7.3.210.0100.00716.50
7.3.200.0060.01016.63
7.3.190.0000.02016.40
7.3.180.0080.00816.53
7.3.170.0030.01516.58
7.3.160.0000.02516.45
7.3.00.0090.00316.59
7.2.330.0060.01216.59
7.2.320.0080.00816.68
7.2.310.0030.01416.47
7.2.300.0070.01116.75
7.2.290.0070.01116.75
7.2.130.0030.01016.65
7.2.120.0030.00917.08
7.2.110.0030.01017.04
7.2.100.0000.01216.82
7.2.90.0140.00017.11
7.2.80.0070.00716.73
7.2.70.0060.01017.22
7.2.60.0050.01016.98
7.2.50.0030.01617.10
7.2.40.0080.00816.86
7.2.30.0070.00717.13
7.2.20.0030.01116.98
7.2.10.0040.01116.84
7.2.00.0070.00716.93
7.1.250.0060.00615.99
7.1.240.0030.01015.58
7.1.230.0050.00515.81
7.1.220.0080.00415.85
7.1.210.0000.01115.74
7.1.200.0020.01215.60
7.1.190.0090.00315.88
7.1.180.0000.00915.70
7.1.170.0060.00615.84
7.1.160.0050.00515.98
7.1.150.0070.01015.73
7.1.140.0080.00615.92
7.1.130.0120.00315.84
7.1.120.0000.01215.70
7.1.110.0000.01315.79
7.1.100.0040.00815.73
7.1.90.0030.01315.82
7.1.80.2190.00916.14
7.1.70.0060.01115.46
7.1.60.0190.00824.59
7.1.50.0560.00424.36
7.1.40.2460.01124.08
7.1.30.2270.01524.10
7.1.20.2240.01224.17
7.1.10.1920.00615.18
7.1.00.1780.00615.22
7.0.330.0040.00715.27
7.0.320.0030.00715.52
7.0.310.0030.01015.45
7.0.300.0070.00315.05
7.0.290.0000.01715.20
7.0.280.0050.00315.33
7.0.270.0090.00315.27
7.0.260.0030.00715.27
7.0.250.0060.00615.47
7.0.240.0050.00815.41
7.0.230.0030.01015.31
7.0.220.0140.00015.43
7.0.210.0030.01015.50
7.0.200.0090.00815.14
7.0.190.2530.00815.12
7.0.180.2380.01415.06
7.0.170.2210.01515.00
7.0.160.2000.01214.94
7.0.150.1820.00815.02
7.0.140.1810.00814.92
7.0.130.1780.00514.97
7.0.120.1730.00814.86
7.0.110.1710.00514.94
7.0.100.1420.01214.76
7.0.90.1450.00314.84
7.0.80.1290.00914.80
7.0.70.1400.00814.91
7.0.60.1350.01014.79
7.0.50.1400.01014.96
7.0.40.1390.00614.07
7.0.30.1400.00914.12
7.0.20.1410.00714.00
7.0.10.1270.01014.07
7.0.00.1380.00814.02
5.6.380.0070.00714.27

preferences:
64.57 ms | 400 KiB | 5 Q