3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $params = array('name' => 'Test', 'age' => 20); $field = 'id'; $value = 2; $where = array_merge($params, array("{$id}" => $value)); echo '<pre>'; print_r($where); echo '</pre>';
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: id in /in/dK218 on line 7 <pre>Array ( [name] => Test [age] => 20 [] => 2 ) </pre>
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: id in /in/dK218 on line 7 <pre>Array ( [name] => Test [age] => 20 [] => 2 ) </pre>