3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $queryString = 'arrFilter_196_73887=Y&arrFilter_197_8145817=&set_filter=%CF%EE%EA%E0%E7%E0%F2%FC'; $queryUrl = parse_url($queryString); //path, query if(isset($queryUrl['query'])) { parse_str($queryUrl['query'], $args); $args = array_filter($args); $queryString = $queryUrl['path'].(count($args) ?'?'.http_build_query($args) :''); } else { parse_str($queryUrl['path'], $args); $args = array_filter($args); $queryString = http_build_query($args); } var_dump($queryUrl, $queryString); //arrFilter_196_73887=Y&arrFilter_197_8145817=&set_filter=%CF%EE%EA%E0%E7%E0%F2%FC
Output for 5.0.0 - 5.0.5, 5.1.1 - 7.1.0
array(1) { ["path"]=> string(80) "arrFilter_196_73887=Y&arrFilter_197_8145817=&set_filter=%CF%EE%EA%E0%E7%E0%F2%FC" } string(57) "arrFilter_196_73887=Y&set_filter=%CF%EE%EA%E0%E7%E0%F2%FC"
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/j6e8E on line 19
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: http_build_query() in /in/j6e8E on line 17
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: http_build_query() in /in/j6e8E on line 17
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: http_build_query() in /in/j6e8E on line 17