I ran into a problem today where I was passing a key with the value set to an empty array to http_build_query(). E.g.:
http_build_query()
$args = array(\"foo\", \"bar\
Can somebody explain to me why this is not a bug?
Technically, I don't think it should be labeled a bug. Rather, it's just how they designed the function to behave, whether others disagree with that decision or not.
Your API could just check with if (empty($_POST['2']))
if (empty($_POST['2']))