3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function __construct() { $item = $this->itemResolver(); foreach(iterator_to_array($item,true) as $number => $value){ var_dump($value); } } public function itemResolver(): \Generator { // $stmt = mysqli_query($db_connect, "select pk_i_id from oc_t_item_resource ORDER by pk_i_id desc"); // $records = mysqli_fetch_all($stmt); $records = [ 0 => [0 => '4031'], 1 => [0 => '4030'], 2 => [0 => '4029'] ]; foreach($records as $record => $value){ yield $value; } } } var_dump(new Test());

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.00718.15
8.3.50.0080.00618.19
8.3.40.0100.01018.69
8.3.30.0140.00018.68
8.3.20.0000.00819.21
8.3.10.0000.00723.68
8.3.00.0000.00820.54
8.2.180.0110.00418.54
8.2.170.0130.00322.96
8.2.160.0030.01020.39
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0050.00319.82
8.2.120.0080.00026.35
8.2.110.0060.00319.07
8.2.100.0060.00617.91
8.2.90.0050.00317.63
8.2.80.0060.00317.97
8.2.70.0030.00517.93
8.2.60.0050.00318.22
8.2.50.0040.00418.10
8.2.40.0000.00719.30
8.2.30.0040.00419.23
8.2.20.0060.00618.02
8.2.10.0070.00018.00
8.2.00.0000.00817.83
8.1.280.0090.00625.92
8.1.270.0040.00418.80
8.1.260.0040.00426.35
8.1.250.0070.00728.09
8.1.240.0060.00322.48
8.1.230.0080.00322.03
8.1.220.0040.00417.77
8.1.210.0040.00418.77
8.1.200.0100.00017.35
8.1.190.0000.00817.35
8.1.180.0000.00918.10
8.1.170.0040.00418.59
8.1.160.0000.00818.87
8.1.150.0040.00418.85
8.1.140.0030.00322.15
8.1.130.0000.00720.20
8.1.120.0000.00717.52
8.1.110.0030.00517.48
8.1.100.0000.00717.43
8.1.90.0040.00417.45
8.1.80.0040.00417.35
8.1.70.0030.00317.45
8.1.60.0060.00317.53
8.1.50.0000.00817.47
8.1.40.0040.00417.48
8.1.30.0080.00417.53
8.1.20.0030.00517.62
8.1.10.0050.00217.57
8.1.00.0000.00917.49
8.0.300.0000.00818.77
8.0.290.0000.00916.75
8.0.280.0030.00318.44
8.0.270.0030.00317.17
8.0.260.0000.00618.32
8.0.250.0060.00316.97
8.0.240.0070.00016.96
8.0.230.0080.00016.86
8.0.220.0030.00316.83
8.0.210.0040.00416.89
8.0.200.0040.00416.88
8.0.190.0040.00416.84
8.0.180.0040.00416.94
8.0.170.0050.00516.82
8.0.160.0000.00716.86
8.0.150.0080.00316.82
8.0.140.0070.00016.86
8.0.130.0030.00313.37
8.0.120.0070.00016.78
8.0.110.0080.00016.82
8.0.100.0000.00716.68
8.0.90.0070.00016.76
8.0.80.0050.01316.84
8.0.70.0000.00716.88
8.0.60.0030.00516.85
8.0.50.0050.00216.82
8.0.30.0130.00616.98
8.0.20.0090.01017.40
8.0.10.0000.00816.94
8.0.00.0130.00516.76
7.4.330.0050.00015.55
7.4.320.0030.00316.57
7.4.300.0030.00516.66
7.4.290.0030.00316.50
7.4.280.0050.00216.59
7.4.270.0030.00316.61
7.4.260.0030.00516.59
7.4.250.0040.00416.54
7.4.240.0030.00516.65
7.4.230.0030.00316.60
7.4.220.0000.00816.49
7.4.210.0120.00516.58
7.4.200.0030.00316.68
7.4.160.0090.00716.46
7.4.140.0110.01117.86
7.4.130.0070.01116.63
7.4.120.0120.00616.48
7.4.110.0180.00616.72
7.4.100.0130.01016.48
7.4.90.0070.01016.44
7.4.80.0100.00619.39
7.4.70.0030.01516.43
7.4.60.0150.00816.48
7.4.50.0030.01216.21
7.4.40.0060.01016.52
7.4.00.0030.01214.93
7.3.330.0050.00013.18
7.3.320.0060.00213.21
7.3.310.0030.00316.38
7.3.300.0070.00016.39
7.3.290.0030.00316.32
7.3.280.0170.00316.33
7.3.260.0080.01216.44
7.3.240.0100.01016.48
7.3.230.0060.01216.34
7.3.210.0110.00616.48
7.3.200.0080.00816.70
7.3.190.0110.01116.38
7.3.180.0110.01116.34
7.3.170.0070.01316.60
7.3.160.0060.00916.43
7.2.330.0140.00416.40
7.2.320.0110.01116.75
7.2.310.0100.00716.75
7.2.300.0030.01316.78
7.2.290.0130.00616.76
7.2.110.0500.01714.80
7.2.100.0230.01114.38
7.2.90.0530.01214.84
7.2.80.0770.00314.62
7.2.70.0490.01014.68
7.2.60.1250.00615.03
7.2.50.0640.01014.82
7.2.40.0510.01214.84
7.2.30.0740.00615.24
7.2.20.0990.00315.03
7.2.10.0800.00914.68
7.2.00.0620.00914.76
7.1.230.0600.00713.89
7.1.220.0100.01414.17
7.1.210.0260.00413.68
7.1.200.0660.00313.87
7.1.190.0380.00313.75
7.1.180.0620.01013.58
7.1.170.0450.00913.80
7.1.160.0730.00613.93
7.1.150.0970.00713.86
7.1.140.0630.01113.70
7.1.130.0670.00713.73
7.1.120.0840.01013.78
7.1.110.0720.00613.67
7.1.100.0740.00913.85
7.1.90.0700.00713.54
7.1.80.0600.01013.53
7.1.70.0610.01013.86
7.1.60.0790.00331.69
7.1.50.1460.01031.80
7.1.40.1170.01031.84
7.1.30.1290.01031.95
7.1.20.1580.00031.56
7.1.10.0950.00713.66
7.1.00.0650.01013.90
5.6.380.0140.00413.82

preferences:
56.5 ms | 400 KiB | 5 Q