3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $q1 = http_build_query(array( '_COOKIE' => array(), '_HEADER' => array( 'User-Agent' => 'Mozilla...' , ), )); $q2 = http_build_query(array( '_COOKIE' => array( '', ), '_HEADER' => array( 'User-Agent' => 'Mozilla...' , ), )); parse_str($q1, $d1); parse_str($q2, $d2); echo '$q1 => '; var_dump($q1); echo '$d1 => '; var_dump($d1); echo "\n"; echo '$q2 => '; var_dump($q2); echo '$d2 => '; var_dump($d2);
Output for 5.6.0 - 7.3.0alpha1
$q1 => string(34) "_HEADER%5BUser-Agent%5D=Mozilla..." $d1 => array(1) { ["_HEADER"]=> array(1) { ["User-Agent"]=> string(10) "Mozilla..." } } $q2 => string(50) "_COOKIE%5B0%5D=&_HEADER%5BUser-Agent%5D=Mozilla..." $d2 => array(2) { ["_COOKIE"]=> array(1) { [0]=> string(0) "" } ["_HEADER"]=> array(1) { ["User-Agent"]=> string(10) "Mozilla..." } }