Re: [PHP-DEV] [PATCH] New, optimized is_numeric_string, and other number stuff

2006-12-19 Thread Matt Wilmas
Hi (again) Ilia, all, After thinking about the zend_smart_strcmp() issue more, I believe a numeric comparison can be used except when *both* values overflow *and* have the same sign (either INF or -INF). I also think it's OK to say an underflow (that becomes an even 0.0) of both values can simply

Re: [PHP-DEV] [PATCH] New, optimized is_numeric_string, and other number stuff

2006-12-18 Thread Matt Wilmas
Hi Ilia, all, I was just looking at zendi_smart_strcmp() and realized something I hadn't considered (more on that in a sec.). First, and unrelated to the new is_numeric_*, because _smart_strcmp() uses zend_strtod() if one operand is a double and the other isn't, it results in ('0.0' == '0x123') b

Re: [PHP-DEV] [PATCH] New, optimized is_numeric_string, and other number stuff

2006-12-17 Thread Matt Wilmas
Hi Ilia, I take it there aren't any issues in array.c or wddx.c? Anyway, I wanted to point out one more is_numeric_* functionality change that I skipped in my original message, but I think it's probably a logic bug in the old code. The end of the old function is: if (end_ptr_double>end_ptr_lon

Re: [PHP-DEV] [PATCH] New, optimized is_numeric_string, and other number stuff

2006-12-13 Thread Matt Wilmas
Hi Ilia, I was kinda thinking the same thing, about having 2 RCs and such to see if any problems were found. Though I try to be very, very careful not to screw things up. ;-) Just wanted to let you know, I made a minor update to the patch since you first saw it yesterday. Realized part of the i

Re: [PHP-DEV] [PATCH] New, optimized is_numeric_string, and other number stuff

2006-12-13 Thread Ilia Alshanetsky
-Original Message- From: Matt Wilmas [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 12, 2006 6:58 AM To: internals@lists.php.net Subject: [PHP-DEV] [PATCH] New, optimized is_numeric_string, and other number stuff Hi all, I rewrote is_numeric_string/unicode to be faster and change

RE: [PHP-DEV] [PATCH] New, optimized is_numeric_string, and other number stuff

2006-12-12 Thread Andi Gutmans
Subject: [PHP-DEV] [PATCH] New, optimized is_numeric_string, > and other number stuff > > Hi all, > > I rewrote is_numeric_string/unicode to be faster and change a > couple things. > The changes being: > 1) Previously, large numbers (very long or "1e500") tha

Re: [PHP-DEV] [PATCH] New, optimized is_numeric_string, and other number stuff

2006-12-12 Thread Andrei Zmievski
Great! Assuming all tests pass, I'm for applying it. -Andrei On Dec 12, 2006, at 6:58 AM, Matt Wilmas wrote: Hi all, I rewrote is_numeric_string/unicode to be faster and change a couple things. The changes being: 1) Previously, large numbers (very long or "1e500") that became INF were ign

Re: [PHP-DEV] [PATCH] New, optimized is_numeric_string, and other number stuff

2006-12-12 Thread Matt Wilmas
Ilia, I can't see anything that would be wrong there... Well, I have to go now, so I won't be able to bother you with another reply for a while. :-) Matt - Original Message - From: "Ilia Alshanetsky" Sent: Tuesday, December 12, 2006 > Matt, > > Take a look at array.c and wddx.c -- PH

Re: [PHP-DEV] [PATCH] New, optimized is_numeric_string, and other number stuff

2006-12-12 Thread Ilia Alshanetsky
Matt, Take a look at array.c and wddx.c On 12-Dec-06, at 11:14 AM, Matt Wilmas wrote: - Original Message - From: "Ilia Alshanetsky" Sent: Tuesday, December 12, 2006 As far as I can tell all tests still pass with the patch, although we have a number of is_numeric_string() uses that wi

Re: [PHP-DEV] [PATCH] New, optimized is_numeric_string, and other number stuff

2006-12-12 Thread Matt Wilmas
- Original Message - From: "Ilia Alshanetsky" Sent: Tuesday, December 12, 2006 > As far as I can tell all tests still pass with the patch, although we > have a number of is_numeric_string() uses that will need to be > adjusted to accommodate the change to the function. Really, like what?

Re: [PHP-DEV] [PATCH] New, optimized is_numeric_string, and other number stuff

2006-12-12 Thread Ilia Alshanetsky
On 12-Dec-06, at 11:00 AM, Matt Wilmas wrote: Hi Ilia, I actually changed +2 to +4. :-) My mistake :) As far as I can tell all tests still pass with the patch, although we have a number of is_numeric_string() uses that will need to be adjusted to accommodate the change to the function.

Re: [PHP-DEV] [PATCH] New, optimized is_numeric_string, and other number stuff

2006-12-12 Thread Matt Wilmas
Hi Ilia, I actually changed +2 to +4. :-) In the original message, I didn't clarify that the % improvement with numbers was obtained using arithmetic operators with one numeric string operand. And the number changes in the parser just made a few % difference in my crude way of trying to test it

Re: [PHP-DEV] [PATCH] New, optimized is_numeric_string, and other number stuff

2006-12-12 Thread Ilia Alshanetsky
Matt, The zend_exceptions.c bit seems incorrect. You change +4 to +2 but there are 4 "text" chars that need to be accounted for there. I am going over the rest of the patch now. Ilia Alshanetsky -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.n

[PHP-DEV] [PATCH] New, optimized is_numeric_string, and other number stuff

2006-12-12 Thread Matt Wilmas
Hi all, I rewrote is_numeric_string/unicode to be faster and change a couple things. The changes being: 1) Previously, large numbers (very long or "1e500") that became INF were ignored (Bug #26349), which is not the behavior anywhere else. 2) Leading whitespace with hex numbers or ones that starte