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)); ?> <a href="?<?= http_build_query(array_merge($query, ['category' => 'val'])) ?>">Категория каталога</a> <a href="?<?= http_build_query(array_merge($query, ['sort' => 'price'])) ?>">Сортировать по цене</a>
Output for 7.2.0 - 7.2.11
Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in /in/EU8vn on line 3 <a href="? Warning: array_merge(): Argument #1 is not an array in /in/EU8vn on line 5 Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in /in/EU8vn on line 5 ">Категория каталога</a> <a href="? Warning: array_merge(): Argument #1 is not an array in /in/EU8vn on line 6 Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in /in/EU8vn on line 6 ">Сортировать по цене</a>
Output for 5.4.0 - 5.6.38, 7.0.0 - 7.1.23
<a href="? Warning: array_merge(): Argument #1 is not an array in /in/EU8vn on line 5 Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in /in/EU8vn on line 5 ">Категория каталога</a> <a href="? Warning: array_merge(): Argument #1 is not an array in /in/EU8vn on line 6 Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in /in/EU8vn on line 6 ">Сортировать по цене</a>
Output for hhvm-3.22.0
<a href="? Warning: Invalid operand type was used: array_merge expects array(s) or collection(s) in /in/EU8vn on line -1 Warning: Invalid argument: formdata: (need Array or Object) in /in/EU8vn on line -1 ">Категория каталога</a> <a href="? Warning: Invalid operand type was used: array_merge expects array(s) or collection(s) in /in/EU8vn on line -1 Warning: Invalid argument: formdata: (need Array or Object) in /in/EU8vn on line -1 ">Сортировать по цене</a>
Output for hhvm-3.19.2 - 3.21.3
<a href="? Warning: Invalid operand type was used: array_merge expects array(s) or collection(s) in /in/EU8vn on line 5 Warning: Invalid argument: formdata: (need Array or Object) in /in/EU8vn on line 5 ">Категория каталога</a> <a href="? Warning: Invalid operand type was used: array_merge expects array(s) or collection(s) in /in/EU8vn on line 6 Warning: Invalid argument: formdata: (need Array or Object) in /in/EU8vn on line 6 ">Сортировать по цене</a>
Output for hhvm-3.17.3 - 3.18.5
<a href="? Warning: Invalid operand type was used: expects array(s) or collection(s) in /in/EU8vn on line 5 Warning: Invalid argument: formdata: (need Array or Object) in /in/EU8vn on line 5 ">Категория каталога</a> <a href="? Warning: Invalid operand type was used: expects array(s) or collection(s) in /in/EU8vn on line 6 Warning: Invalid argument: formdata: (need Array or Object) in /in/EU8vn on line 6 ">Сортировать по цене</a>
Output for hhvm-3.10.1 - 3.15.4
<a href="? Warning: array_merge() expects parameter 1 to be array, null given in /in/EU8vn on line 5 Warning: Invalid argument: formdata: (need Array or Object) in /in/EU8vn on line 5 ">Категория каталога</a> <a href="? Warning: array_merge() expects parameter 1 to be array, null given in /in/EU8vn on line 6 Warning: Invalid argument: formdata: (need Array or Object) in /in/EU8vn on line 6 ">Сортировать по цене</a>
Output for 5.1.2 - 5.3.29
<a href="?<?= http_build_query(array_merge($query, ['category' => 'val'])) ?>">Категория каталога</a> <a href="?<?= http_build_query(array_merge($query, ['sort' => 'price'])) ?>">Сортировать по цене</a>
Output for 4.3.0 - 5.1.1
Notice: Use of undefined constant PHP_URL_QUERY - assumed 'PHP_URL_QUERY' in /in/EU8vn on line 3 Warning: parse_url() expects exactly 1 parameter, 2 given in /in/EU8vn on line 3 <a href="?<?= http_build_query(array_merge($query, ['category' => 'val'])) ?>">Категория каталога</a> <a href="?<?= http_build_query(array_merge($query, ['sort' => 'price'])) ?>">Сортировать по цене</a>