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($array, $qs); } else { $qs .= $par.'='.$val.'&'; } } return $qs; } $qs = bqs($arr);
based on 8YoUk
Output for 7.0.0 - 7.1.0
order_source%5B0%5D=google&order_source%5B1%5D=facebook&order_medium=google-text Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 262144 bytes) in /in/i9fiM on line 9
Process exited with code 255.
Output for 5.4.0 - 5.6.28
order_source%5B0%5D=google&order_source%5B1%5D=facebook&order_medium=google-text Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 130968 bytes) in /in/i9fiM on line 11
Process exited with code 255.
Output for 5.3.0 - 5.3.29
order_source%5B0%5D=google&order_source%5B1%5D=facebook&order_medium=google-text Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 523800 bytes) in /in/i9fiM on line 11
Process exited with code 255.
Output for 5.1.3 - 5.2.17
order_source%5B0%5D=google&order_source%5B1%5D=facebook&order_medium=google-text
Process exited with code 139.
Output for 5.0.0 - 5.1.2
order_source[0]=google&order_source[1]=facebook&order_medium=google-text
Process exited with code 139.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: http_build_query() in /in/i9fiM 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/i9fiM 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/i9fiM on line 3