Re: Re: http_build_query unexpected/bad behaviour

From: Date: Thu, 03 Jun 2004 17:04:24 +0000
Subject: Re: Re: http_build_query unexpected/bad behaviour
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-10264@lists.php.net to get a copy of this message
Sara Golemon wrote:
the issue is that the array $y below results in an empty string: $x = array('e' => array('kf' => '')); $y = array('e' => array('kf' => array())); echo '\''. http_build_query($x). "'\n"; echo '\''. http_build_query($y) . "'\n"; running on: PHP 5.0.0RC3-dev (cli) (built: Jun 1 2004 18:04:30) (DEBUG) ---- would anybody care to comment as to whether this is what is intended?
I would definately call that intended. What would you expect the resultant query string to look like?
my original assumption was that both cases would produce the same result. I don't see the rationale (although internally it may be obvious) that the second array 'resolves' (is that the correct use of the word?) into an empty string. - an empty string is a valid value for a param coming from the POST/GET request, php's loose nature lead me to assume the an empty array in such a context would result in at least the some output - I went with the feeling that an empty array is not emptier than an empty string. anyway, thanks for the feedback.
-Sara


« previous php.internals (#10264) next »