3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SimDB { private static $count = 0; public static function mysqli_fetch_array($result) { if (self::$count < 10) { self::$count++; return "Row" . self::$count; } else { return false; } } public static function reset() { self::$count = 0; } } $result1 = ""; // This is simulated, so not an actual result set resource while ($row1 = SimDB::mysqli_fetch_array($result1)); echo "Value of \$row1 => $row1\n\n"; echo "Actually store all the results\n"; SimDB::reset(); while ($row1[] = SimDB::mysqli_fetch_array($result1)); var_dump($row1); echo "\n\n How you would actually use a while() loop\n\n"; SimDB::reset(); while ($row = SimDB::mysqli_fetch_array($result1)) { echo "Row = $row\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.5.10.0100.00917.07
8.5.00.0130.00920.29
8.4.160.0140.01023.35
8.4.150.0020.00014.05
8.4.140.0140.00919.46
8.4.130.0100.01017.64
8.4.120.0120.00920.58
8.4.110.0120.00820.64
8.4.100.0090.01118.11
8.4.90.0120.00917.81
8.4.80.0140.00718.02
8.4.70.0140.00518.25
8.4.60.0050.00418.66
8.4.50.0050.00318.79
8.4.40.0030.00717.84
8.4.30.0070.01019.46
8.4.20.0110.01117.72
8.4.10.0070.01419.56
8.3.280.0140.00718.52
8.3.270.0140.00616.67
8.3.260.0120.00716.90
8.3.250.0090.00518.91
8.3.240.0090.01116.75
8.3.230.0090.00216.93
8.3.220.0100.00716.86
8.3.210.0080.01216.85
8.3.200.0030.00616.84
8.3.190.0050.00317.20
8.3.180.0110.00916.65
8.3.170.0070.01118.87
8.3.160.0060.01217.32
8.3.150.0140.00017.21
8.3.140.0080.00016.69
8.3.130.0130.00616.69
8.3.120.0060.00918.82
8.3.110.0060.00320.94
8.3.100.0080.00024.06
8.3.90.0040.01126.77
8.3.80.0100.00018.55
8.3.70.0120.00318.18
8.3.60.0130.00316.75
8.3.50.0120.00717.31
8.3.40.0120.00418.54
8.3.30.0160.00318.84
8.3.20.0050.00320.21
8.3.10.0040.00421.65
8.3.00.0060.00319.80
8.2.290.0140.00520.69
8.2.280.0110.00920.06
8.2.270.0070.00717.26
8.2.260.0030.00618.33
8.2.250.0090.00018.59
8.2.240.0090.00918.77
8.2.230.0030.00722.58
8.2.220.0040.00437.54
8.2.210.0040.00426.77
8.2.200.0040.00416.75
8.2.190.0100.01017.00
8.2.180.0130.01018.54
8.2.170.0120.00622.96
8.2.160.0110.00419.16
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0000.00819.14
8.2.120.0070.00026.35
8.2.110.0050.00521.04
8.2.100.0000.01117.84
8.2.90.0030.00519.17
8.2.80.0030.00617.97
8.2.70.0060.00317.61
8.2.60.0030.00617.80
8.2.50.0030.00518.10
8.2.40.0060.00322.17
8.2.30.0040.00419.37
8.2.20.0000.01018.14
8.2.10.0040.00418.21
8.2.00.0000.00718.08
8.1.330.0130.00616.57
8.1.320.0120.00616.49
8.1.310.0070.00718.69
8.1.300.0060.00318.46
8.1.290.0000.00918.88
8.1.280.0180.00325.92
8.1.270.0040.00422.19
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00323.92
8.1.230.0080.00419.14
8.1.220.0090.00017.74
8.1.210.0060.00318.77
8.1.200.0090.00017.24
8.1.190.0040.00417.35
8.1.180.0090.00018.10
8.1.170.0040.00418.65
8.1.160.0070.00019.05
8.1.150.0040.00418.88
8.1.140.0070.00019.47
8.1.130.0000.00718.76
8.1.120.0040.00417.44
8.1.110.0040.00417.28
8.1.100.0000.00817.50
8.1.90.0050.00217.35
8.1.80.0000.00817.33
8.1.70.0000.00717.42
8.1.60.0060.00317.64
8.1.50.0000.00817.48
8.1.40.0080.00017.40
8.1.30.0030.00517.64
8.1.20.0000.00717.66
8.1.10.0000.00817.57
8.1.00.0040.00417.52
8.0.300.0070.00018.77
8.0.290.0000.00816.75
8.0.280.0030.00318.39
8.0.270.0070.00017.16
8.0.260.0060.00317.39
8.0.250.0040.00416.86
8.0.240.0030.00616.98
8.0.230.0040.00417.00
8.0.220.0000.00916.93
8.0.210.0080.00016.92
8.0.200.0060.00016.88
8.0.190.0040.00416.95
8.0.180.0000.00716.95
8.0.170.0030.00617.00
8.0.160.0000.00816.89
8.0.150.0040.00416.91
8.0.140.0040.00416.86
8.0.130.0080.00013.37
8.0.120.0050.00216.93
8.0.110.0070.00016.77
8.0.100.0050.00516.75
8.0.90.0000.00716.81
8.0.80.0040.01116.88
8.0.70.0000.00817.04
8.0.60.0050.00216.76
8.0.50.0000.00816.96
8.0.30.0040.01217.08
8.0.20.0140.00517.40
8.0.10.0000.00816.84
8.0.00.0130.00316.69
7.4.330.0030.00315.55
7.4.320.0030.00316.46
7.4.300.0060.00016.61
7.4.290.0030.00516.48
7.4.280.0070.00016.53
7.4.270.0080.00016.58
7.4.260.0040.00416.50
7.4.250.0070.00016.68
7.4.240.0080.00016.40
7.4.230.0000.00716.53
7.4.220.0100.00616.50
7.4.210.0110.00416.55
7.4.200.0000.00716.65
7.4.160.0100.00716.49
7.4.150.0150.00517.40
7.4.140.0090.01117.86
7.4.130.0160.00316.52
7.4.120.0100.01016.57
7.4.110.0130.01316.53
7.4.100.0070.01116.63
7.4.90.0090.00816.45
7.4.80.0040.01319.39
7.4.70.0150.00916.41
7.4.60.0120.00616.51
7.4.50.0060.00616.60
7.4.40.0150.00716.52
7.4.30.0080.00816.52
7.4.00.0070.00415.09
7.3.330.0000.00713.40
7.3.320.0030.00313.38
7.3.310.0040.00416.44
7.3.300.0070.00016.34
7.3.290.0050.01016.38
7.3.280.0080.00816.39
7.3.270.0160.00317.40
7.3.260.0090.01216.64
7.3.250.0080.01016.54
7.3.240.0110.01016.53
7.3.230.0040.01416.61
7.3.210.0080.00916.35
7.3.200.0130.01016.44
7.3.190.0000.01916.73
7.3.180.0100.00716.38
7.3.170.0070.01016.52
7.3.160.0070.01116.64
7.3.10.0030.01016.55
7.3.00.0070.00416.38
7.2.330.0080.01016.66
7.2.320.0120.00416.81
7.2.310.0120.00616.78
7.2.300.0150.00316.59
7.2.290.0040.01516.67
7.2.130.0100.00416.79
7.2.120.0080.00816.45
7.2.110.0000.01116.87
7.2.100.0070.00716.42
7.2.90.0130.00016.83
7.2.80.0110.00016.75
7.2.70.0000.01216.81
7.2.60.0080.01016.87
7.2.50.0040.00716.86
7.2.40.0100.01016.71
7.2.30.0060.00617.05
7.2.20.0000.01516.76
7.2.10.0110.00716.69
7.2.00.0070.00416.93
7.1.250.0060.01215.67
7.1.200.0030.00715.91
7.1.70.0270.01415.34
7.1.60.0540.01033.10
7.1.50.0400.02332.96
7.1.40.1030.01432.63
7.1.30.0290.01532.72
7.1.20.0290.01332.79
7.1.10.0220.00715.01
7.1.00.0200.00914.83
7.0.200.0280.01315.08
7.0.190.0350.01214.92
7.0.180.0310.01014.65
7.0.170.0270.00914.65
7.0.160.0380.01014.53
7.0.150.0200.01014.37
7.0.140.0220.01014.32
7.0.130.0270.01314.64
7.0.120.0310.01014.86
7.0.110.0310.01014.75
7.0.100.0190.01014.41
7.0.90.0290.01314.41
7.0.80.0240.01014.75
7.0.70.0230.01014.45
7.0.60.0320.00614.37
7.0.50.0310.00414.45
7.0.40.0360.00814.60
7.0.30.0380.00614.58
7.0.20.0310.00614.64
7.0.10.0440.00214.49
7.0.00.0220.01014.54

preferences:
163.27 ms | 403 KiB | 5 Q