3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $runs = $itemcount / 2500; // Around 80 smaller queries for ($i = 0; $i <= $runs; $i++) { $offset = $i * 2500; $sql = "SELECT id,title,price,description FROM items LIMIT 2500,$offset"; $result = $mysqli->query($sql); while ($obj = $result->fetch_object()) { // testing - do nothing } echo "Run: ".$i."<br />"; } ?>
based on jPdtA
Output for 7.0.5 - 7.2.6
Notice: Undefined variable: itemcount in /in/n957u on line 2 Notice: Undefined variable: mysqli in /in/n957u on line 6 Fatal error: Uncaught Error: Call to a member function query() on null in /in/n957u:6 Stack trace: #0 {main} thrown in /in/n957u on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: itemcount in /in/n957u on line 2 Notice: Undefined variable: mysqli in /in/n957u on line 6 Fatal error: Uncaught Error: Call to a member function query() on unknown in /in/n957u:6 Stack trace: #0 {main} thrown in /in/n957u on line 6
Process exited with code 255.
Output for 5.6.7 - 5.6.28
Notice: Undefined variable: itemcount in /in/n957u on line 2 Notice: Undefined variable: mysqli in /in/n957u on line 6 Fatal error: Call to a member function query() on null in /in/n957u on line 6
Process exited with code 255.
Output for 5.0.4 - 5.5.35
Notice: Undefined variable: itemcount in /in/n957u on line 2 Notice: Undefined variable: mysqli in /in/n957u on line 6 Fatal error: Call to a member function query() on a non-object in /in/n957u on line 6
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: itemcount in /in/n957u on line 2 Notice: Undefined variable: mysqli in /in/n957u on line 6 Fatal error: Call to a member function query() on a non-object in /in/n957u on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Notice: Undefined variable: itemcount in /in/n957u on line 2 Fatal error: Call to a member function on a non-object in /in/n957u on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: itemcount in /in/n957u on line 2 Fatal error: Call to a member function on a non-object in /in/n957u on line 6