Re: is_numeric_string causes function inconsistency

From: Date: Fri, 11 Aug 2006 11:40:37 +0000
Subject: Re: is_numeric_string causes function inconsistency
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-25313@lists.php.net to get a copy of this message
Hi Andrei, You seem to be the array-function-person ;-) so I'll ask you if the array_count_values() result in my previous message is what's intended? Seems to me leading whitespace should *not* be ignored. I didn't try it yet, but it seems zend_[u_]symtable_[find|update] should simply be used, instead of is_numeric..., and the HANDLE_NUMERIC() macro will take care of things just as with array keys in $a[...]. That's how the function worked in 4.x it appears, where zend_hash_[find|update] had HANDLE_NUMERIC() (before symtable functions). Am I correct? Should I make a patch? Oh, and something I just thought of looking at the code -- you think the function could/should also count IS_DOUBLE values? After converting to string, of course. :-) Thanks, Matt ----- Original Message ----- From: "Matt W" Sent: Sunday, August 06, 2006 > ... > > Also, is this the desired behavior of array_count_values() (manual doesn't > say; it also uses is_numeric...)? > > print_r(array_count_values(array(1, ' 1', ' 1 '))) > Array > ( > [1] => 2 > [ 1 ] => 1 > )

« previous php.internals (#25313) next »