3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array('order_source' => array('google','facebook'), '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; } $qs = bqs($arr);
based on i9fiM
Output for 5.1.3 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
order_source%5B0%5D=google&order_source%5B1%5D=facebook&order_medium=google-text
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.1.2
order_source[0]=google&order_source[1]=facebook&order_medium=google-text
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: http_build_query() in /in/6LV8G on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: http_build_query() in /in/6LV8G on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: http_build_query() in /in/6LV8G on line 3