3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $url = 'http://mysite.com/hello/world?look_at=me'; $query = parse_str(parse_url($url, PHP_URL_QUERY)); var_dump($query); var_dump(http_build_query(array_merge($query, ['category' => 'val']))); ?>
based on Z59W1
Output for 7.2.0
Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in /in/Fu8OD on line 3 NULL Warning: array_merge(): Argument #1 is not an array in /in/Fu8OD on line 5 Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in /in/Fu8OD on line 5 bool(false)
Output for 5.4.8 - 7.1.10
NULL Warning: array_merge(): Argument #1 is not an array in /in/Fu8OD on line 5 Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in /in/Fu8OD on line 5 bool(false)
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/Fu8OD on line 5
Process exited with code 255.