#7869 [Opn->Bgs]: parse_str produces no trapable value
| From: | iliaa@php.net | Date: | Fri, 07 Feb 2003 03:33:25 +0000 |
| Subject: | #7869 [Opn->Bgs]: parse_str produces no trapable value | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-32355@lists.php.net to get a copy of this message | ||
ID: 7869
Updated by: iliaa@php.net
Reported By: bens@benjamindsmith.com
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: RH Linux 6.2
PHP Version: 4.0.3pl1
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
I believe that since there is a way to fetch the data in form of an
array this feature request is mostly pointless.
Previous Comments:
------------------------------------------------------------------------
[2001-01-21 03:57:45] cynic@php.net
have parse_str return would be certainly good; as a workaround you can
use
parse_str( $s , $a ) ;
if( 0 == count( $a ) ) {
# problem
...
------------------------------------------------------------------------
[2000-11-17 22:05:57] bens@benjamindsmith.com
<?
$string="?a=1&b=2";
if (!false===parse_str($string))
{
// all is happy
}
else {
// Whoops! error handling...
}
?>
I would submit that to maintain the elegant conventions of PHP, it
would be good to return
A) The number of variables parsed (I'll leave in your court how to
handle counting the # of array variables parsed)
or
B) false if the string was null, corrupt or "un-parsable".
Currently, the only way to evaluate the success of this function is to
know the last variable that is/should be in the input stream and check
to see that THAT variable exists after running this function = less
than optimum.
Thanks!
-Ben
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=7869&edit=1