3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $params = array('name' => 'Test', 'age' => 20, 'id' => 12); $field = 'id'; $value = 2; $where = array_merge(array("${field}" => $value), $params); echo '<pre>'; print_r($where); echo '</pre>';
Output for 4.3.0 - 7.1.0
<pre>Array ( [id] => 12 [name] => Test [age] => 20 ) </pre>