3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $query="select country,admin1,admin2,admin3,admin4 from geoname where geonameid=$id"; $result=$mysqli->query($query); $groups=array(); if(!$result) { die('something wrong with database> ' . $mysqli->error); } $row = $result->fetch_object(); $sql=''; for($i=1;$i<$lvl;$i++) { $admin='admin'.$i; $sql.=$admin.'='.$row->$admin; }
Output for 7.0.5 - 7.1.0
Notice: Undefined variable: id in /in/jE9tG on line 2 Notice: Undefined variable: mysqli in /in/jE9tG on line 3 Fatal error: Uncaught Error: Call to a member function query() on null in /in/jE9tG:3 Stack trace: #0 {main} thrown in /in/jE9tG on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: id in /in/jE9tG on line 2 Notice: Undefined variable: mysqli in /in/jE9tG on line 3 Fatal error: Uncaught Error: Call to a member function query() on unknown in /in/jE9tG:3 Stack trace: #0 {main} thrown in /in/jE9tG on line 3
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: id in /in/jE9tG on line 2 Notice: Undefined variable: mysqli in /in/jE9tG on line 3 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function query() on a non-object (null)' in /in/jE9tG:3 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.7 - 5.6.28
Notice: Undefined variable: id in /in/jE9tG on line 2 Notice: Undefined variable: mysqli in /in/jE9tG on line 3 Fatal error: Call to a member function query() on null in /in/jE9tG on line 3
Process exited with code 255.
Output for 5.0.4 - 5.5.35
Notice: Undefined variable: id in /in/jE9tG on line 2 Notice: Undefined variable: mysqli in /in/jE9tG on line 3 Fatal error: Call to a member function query() on a non-object in /in/jE9tG on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: id in /in/jE9tG on line 2 Notice: Undefined variable: mysqli in /in/jE9tG on line 3 Fatal error: Call to a member function query() on a non-object in /in/jE9tG on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Notice: Undefined variable: id in /in/jE9tG on line 2 Fatal error: Call to a member function on a non-object in /in/jE9tG on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: id in /in/jE9tG on line 2 Fatal error: Call to a member function on a non-object in /in/jE9tG on line 3