3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if($stmt=$connection->prepare('SELECT user_ID FROM users WHERE email=(?)')) { $stmt->bind_param('s',$email); $stmt->execute(); $stmt->bind_result($user_ID); while ($stmt->fetch()) { $user=$user_ID; } if($stmt->errno!==0) { } $stmt->close(); } else { }
Output for 7.0.30 - 7.3.1
Notice: Undefined variable: connection in /in/gb4p9 on line 3 Fatal error: Uncaught Error: Call to a member function prepare() on null in /in/gb4p9:3 Stack trace: #0 {main} thrown in /in/gb4p9 on line 3
Process exited with code 255.
Output for hhvm-3.22.0
Notice: Undefined variable: connection in /in/gb4p9 on line -1 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function prepare() on a non-object (null)' in /in/gb4p9:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Notice: Undefined variable: connection in /in/gb4p9 on line 3 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function prepare() on a non-object (null)' in /in/gb4p9:3 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.30
Notice: Undefined variable: connection in /in/gb4p9 on line 3 Fatal error: Call to a member function prepare() on null in /in/gb4p9 on line 3
Process exited with code 255.