3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $updates = [ "service" => "k", "price" => "85.0", "id" => "442" ]; $test=extract($updates); var_dump($service,$price,$id); //take the keys above and turn them into variables like the ones shown below $stmt->bind_param(str_repeat("s", count(updates)),$service,$price,$id);
based on 1t1Fd
Output for 7.1.0 - 7.3.0rc3
string(1) "k" string(4) "85.0" string(3) "442" Notice: Undefined variable: stmt in /in/VkWGB on line 12 Fatal error: Uncaught Error: Call to a member function bind_param() on null in /in/VkWGB:12 Stack trace: #0 {main} thrown in /in/VkWGB on line 12
Process exited with code 255.
Output for hhvm-3.22.0
string(1) "k" string(4) "85.0" string(3) "442" Notice: Undefined variable: stmt in /in/VkWGB on line -1 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function bind_param() on a non-object (null)' in /in/VkWGB:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
string(1) "k" string(4) "85.0" string(3) "442" Notice: Undefined variable: stmt in /in/VkWGB on line 12 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function bind_param() on a non-object (null)' in /in/VkWGB:12 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
string(1) "k" string(4) "85.0" string(3) "442" Notice: Undefined variable: stmt in /in/VkWGB on line 12 Fatal error: Call to a member function bind_param() on null in /in/VkWGB on line 12
Process exited with code 255.