3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array('order_source' => 'google', 'order_medium' => 'google-text'); //echo http_build_query($arr); function bqs($array, $qs='') { foreach($array as $par => $val) { if(is_array($val)) { bqs($val, $qs); } else { $qs .= $par.'='.$val.'&'; } } return $qs; } //echo $qs = bqs($arr); foreach($arr as $par => $val) { foreach($val as $v) { echo $v; exit; } }
based on 9m6ZC
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: Invalid argument supplied for foreach() in /in/sibRL on line 25 Warning: Invalid argument supplied for foreach() in /in/sibRL on line 25
Output for hhvm-3.12.0
Warning: Invalid argument supplied for foreach() in /in/sibRL on line 28 Warning: Invalid argument supplied for foreach() in /in/sibRL on line 28
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.11