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 parse_str($queryUrl['query'], $args); $args = array_filter($args); $queryString = $queryUrl['path'].(count($args) ?'?'.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.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined index: query in /in/4CKnv on line 5 array(1) { ["path"]=> string(80) "arrFilter_196_73887=Y&arrFilter_197_8145817=&set_filter=%CF%EE%EA%E0%E7%E0%F2%FC" } string(80) "arrFilter_196_73887=Y&arrFilter_197_8145817=&set_filter=%CF%EE%EA%E0%E7%E0%F2%FC"
Output for 4.3.0 - 5.0.5, 5.1.1 - 5.2.17
Notice: Undefined index: query in /in/4CKnv on line 5 array(1) { ["path"]=> string(80) "arrFilter_196_73887=Y&arrFilter_197_8145817=&set_filter=%CF%EE%EA%E0%E7%E0%F2%FC" } string(80) "arrFilter_196_73887=Y&arrFilter_197_8145817=&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/4CKnv on line 10
Process exited with code 255.