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 $field){ var_dump($field); } } 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.0090.00618.43
8.3.50.0120.00318.16
8.3.40.0170.00318.54
8.3.30.0170.00318.29
8.3.20.0060.00319.16
8.3.10.0000.00823.66
8.3.00.0030.00620.65
8.2.180.0150.00318.41
8.2.170.0070.00722.96
8.2.160.0130.00320.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0090.00019.77
8.2.120.0080.00026.35
8.2.110.0100.00022.11
8.2.100.0060.00617.84
8.2.90.0060.00317.88
8.2.80.0060.00317.97
8.2.70.0060.00317.93
8.2.60.0040.00418.22
8.2.50.0080.00018.10
8.2.40.0000.00919.33
8.2.30.0040.00419.32
8.2.20.0030.00617.93
8.2.10.0040.00418.12
8.2.00.0050.00317.59
8.1.280.0120.00625.92
8.1.270.0080.00018.67
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00023.82
8.1.230.0040.00718.95
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0060.00317.22
8.1.180.0000.00818.10
8.1.170.0050.00318.57
8.1.160.0070.00018.98
8.1.150.0000.00818.79
8.1.140.0030.00322.07
8.1.130.0000.00820.26
8.1.120.0000.00717.51
8.1.110.0040.00417.42
8.1.100.0070.00017.34
8.1.90.0000.00717.35
8.1.80.0000.00717.50
8.1.70.0000.00717.46
8.1.60.0030.00617.54
8.1.50.0040.00417.40
8.1.40.0050.00317.41
8.1.30.0080.00317.66
8.1.20.0020.00517.61
8.1.10.0070.00017.50
8.1.00.0040.00417.49
8.0.300.0040.00419.60
8.0.290.0030.00716.75
8.0.280.0070.00018.45
8.0.270.0030.00317.30
8.0.260.0030.00318.40
8.0.250.0030.00616.82
8.0.240.0030.00316.93
8.0.230.0040.00416.91
8.0.220.0030.00316.76
8.0.210.0080.00016.82
8.0.200.0030.00317.00
8.0.190.0030.00616.84
8.0.180.0040.00416.95
8.0.170.0030.00616.89
8.0.160.0000.00716.88
8.0.150.0000.00716.86
8.0.140.0000.00716.72
8.0.130.0060.00013.25
8.0.120.0040.00416.74
8.0.110.0000.00716.76
8.0.100.0000.00716.91
8.0.90.0070.00016.83
8.0.80.0100.00516.89
8.0.70.0070.00016.69
8.0.60.0050.00316.71
8.0.50.0030.00516.73
8.0.30.0050.01617.10
8.0.20.0140.00817.40
8.0.10.0000.00716.88
8.0.00.0120.00616.87
7.4.330.0000.00515.55
7.4.320.0030.00316.50
7.4.300.0040.00416.55
7.4.290.0070.00016.64
7.4.280.0040.00416.57
7.4.270.0000.00716.61
7.4.260.0000.00816.61
7.4.250.0040.00416.47
7.4.240.0000.00716.58
7.4.230.0030.00316.50
7.4.220.0070.00016.70
7.4.210.0110.00716.55
7.4.200.0030.00316.39
7.4.160.0080.00916.52
7.4.140.0120.00917.86
7.4.130.0030.01416.55
7.4.120.0110.00816.50
7.4.110.0070.01416.60
7.4.100.0120.00616.34
7.4.90.0070.01016.37
7.4.80.0060.01219.39
7.4.70.0130.00416.46
7.4.60.0080.00816.40
7.4.50.0070.00716.33
7.4.40.0090.00916.40
7.4.10.0070.01314.87
7.4.00.0080.00614.67
7.3.330.0060.00013.21
7.3.320.0030.00313.30
7.3.310.0000.00716.34
7.3.300.0000.00716.37
7.3.290.0070.00016.22
7.3.280.0030.01716.36
7.3.260.0100.00916.45
7.3.240.0090.01116.41
7.3.230.0200.00016.29
7.3.210.0030.01316.55
7.3.200.0120.00416.43
7.3.190.0130.01016.53
7.3.180.0100.00616.42
7.3.170.0090.00916.56
7.3.160.0040.01116.44
7.3.130.0060.01214.80
7.3.120.0070.00714.70
7.3.110.0090.00914.78
7.3.100.0040.00714.84
7.3.90.0030.00915.07
7.3.80.0030.01014.58
7.3.70.0090.00314.99
7.3.60.0070.00714.72
7.3.50.0030.01114.74
7.3.40.0000.01214.81
7.3.30.0070.00714.54
7.3.20.0080.00816.74
7.3.10.0030.01016.91
7.3.00.0080.00416.48
7.2.330.0050.01416.65
7.2.320.0080.01116.72
7.2.310.0080.00816.68
7.2.300.0090.00616.57
7.2.290.0030.01916.84
7.2.260.0100.00715.23
7.2.250.0150.00415.09
7.2.240.0070.00715.36
7.2.230.0070.00714.91
7.2.220.0060.01214.75
7.2.210.0040.00915.04
7.2.200.0000.00815.16
7.2.190.0060.01215.14
7.2.180.0000.01415.10
7.2.170.0030.00915.24
7.2.160.0070.00715.10
7.2.150.0060.00916.97
7.2.140.0040.00816.85
7.2.130.0070.00716.86
7.2.120.0070.00716.65
7.2.110.0490.01015.51
7.2.100.0700.00815.27
7.2.90.0460.00615.47
7.2.80.0470.00715.41
7.2.70.0360.00615.78
7.2.60.0450.00815.54
7.2.50.0310.00515.56
7.2.40.0250.01015.58
7.2.30.0700.00715.52
7.2.20.0580.00815.52
7.2.10.0450.01115.57
7.2.00.0520.00915.73
7.1.330.0110.00315.65
7.1.320.0040.01415.77
7.1.310.0090.00315.87
7.1.300.0070.00315.38
7.1.290.0060.00315.52
7.1.280.0000.01315.90
7.1.270.0000.01215.59
7.1.260.0030.00715.48
7.1.250.0000.01215.76
7.1.240.0060.00315.95
7.1.230.0480.00814.30
7.1.220.0580.00814.33
7.1.210.0450.00314.40
7.1.200.0510.00414.38
7.1.190.0320.00614.34
7.1.180.0540.00714.48
7.1.170.0460.00814.39
7.1.160.0350.00314.49
7.1.150.0440.01014.48
7.1.140.0440.00814.54
7.1.130.0290.00914.47
7.1.120.0450.00614.46
7.1.110.0330.00714.53
7.1.100.0340.00714.38
7.1.90.0340.00614.36
7.1.80.0330.00514.36
7.1.70.0260.01314.46
7.1.60.0700.00726.30
7.1.50.0700.01226.36
7.1.40.0590.01026.43
7.1.30.0760.01026.32
7.1.20.0610.00526.45
7.1.10.0360.01114.26
7.1.00.0340.01214.24
7.0.330.0040.00715.42
7.0.320.0030.01015.50
7.0.310.0090.00615.25
7.0.300.0040.00715.45
7.0.290.0000.01315.46
7.0.280.0060.00615.33
7.0.270.0050.00515.52
7.0.260.0030.01015.54
7.0.250.0030.00615.38
7.0.240.0060.00615.59
7.0.230.0060.00615.36
7.0.220.0030.01015.45
7.0.210.0070.00715.35
7.0.200.0000.00815.57
7.0.190.0100.00015.51
7.0.180.0140.00015.49
7.0.170.0030.00515.53
7.0.160.0090.00315.15
7.0.150.0120.00315.24
7.0.140.0000.00915.25
7.0.130.0040.01115.41
7.0.120.0070.00715.47
7.0.110.0040.00815.17
7.0.100.0040.01115.52
7.0.90.0070.01115.33
7.0.80.0070.00715.50
7.0.70.0100.00315.46
7.0.60.0030.00715.18
7.0.50.0110.00415.58
7.0.40.0070.00713.35
7.0.30.0070.01013.47
7.0.20.0000.01113.59
7.0.10.0000.01313.66
7.0.00.0070.01013.54
5.6.400.0030.00713.98
5.6.390.0070.00714.30
5.6.380.0100.00514.00
5.6.370.0030.00614.32
5.6.360.0040.01214.10
5.6.350.0080.00014.25
5.6.340.0090.00014.25
5.6.330.0030.01013.96
5.6.320.0060.00614.33
5.6.310.0030.01414.30
5.6.300.0130.00313.93
5.6.290.0080.00814.36
5.6.280.0000.01014.19
5.6.270.0090.00614.25
5.6.260.0040.01214.09
5.6.250.0110.00414.09
5.6.240.0120.00314.14
5.6.230.0090.00914.17
5.6.220.0000.00914.36
5.6.210.0000.01414.11
5.6.200.0070.00414.14
5.6.190.0000.01214.25
5.6.180.0040.01114.25
5.6.170.0070.00714.11
5.6.160.0080.00314.41
5.6.150.0060.00614.03
5.6.140.0150.00014.12
5.6.130.0100.00314.00
5.6.120.0000.01514.36
5.6.110.0040.00814.32
5.6.100.0040.01114.25
5.6.90.0000.01213.84
5.6.80.0070.00713.92
5.6.70.0090.00314.08
5.6.60.0100.00013.99
5.6.50.0040.01114.05
5.6.40.0110.00314.00
5.6.30.0060.00614.13
5.6.20.0070.00314.24
5.6.10.0040.01114.10
5.6.00.0090.00313.92

preferences:
32.76 ms | 400 KiB | 5 Q