Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10264 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30582 invoked by uid 1010); 3 Jun 2004 17:04:26 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 30505 invoked from network); 3 Jun 2004 17:04:25 -0000 Received: from unknown (HELO conan.ard.nu) (217.148.166.184) by pb1.pair.com with SMTP; 3 Jun 2004 17:04:25 -0000 Received: from [127.0.0.1] (helo=iamjochem.com) by conan.ard.nu with esmtp (Exim 4.32) id 1BVvdh-00083G-0r for internals@lists.php.net; Thu, 03 Jun 2004 19:04:25 +0200 Message-ID: <40BF5A18.9020101@iamjochem.com> Date: Thu, 03 Jun 2004 19:04:24 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 CC: internals@lists.php.net References: <40BE1285.9010701@iamjochem.com> <20040602204304.35253.qmail@pb1.pair.com> In-Reply-To: <20040602204304.35253.qmail@pb1.pair.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: http_build_query unexpected/bad behaviour From: jochem@iamjochem.com (Jochem Maas) 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 >