*/
zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv )
{
- int is_numeric = 0;
+ zend_uchar is_numeric = 0;
zend_long lval = 0;
double dval = 0;
COLLATOR_CONVERT_RETURN_FAILED( str );
}
- if( ( is_numeric = collator_is_numeric( (UChar*) Z_STRVAL_P(str), UCHARS( Z_STRLEN_P(str) ), &lval, &dval, 1 ) ) )
+ if ( ( is_numeric = collator_is_numeric( (UChar*) Z_STRVAL_P(str), UCHARS( Z_STRLEN_P(str) ), &lval, &dval, /* allow_errors */ 1 ) ) )
{
if( is_numeric == IS_LONG ) {
ZVAL_LONG(rv, lval);
/* {{{ collator_is_numeric]
* Taken from PHP6:is_numeric_unicode()
*/
-zend_uchar collator_is_numeric( UChar *str, int32_t length, zend_long *lval, double *dval, int allow_errors )
+zend_uchar collator_is_numeric( UChar *str, int32_t length, zend_long *lval, double *dval, bool allow_errors )
{
zend_long local_lval;
double local_dval;
if (!allow_errors) {
return 0;
}
- if (allow_errors == -1) {
- zend_error(E_NOTICE, "A non well formed numeric value encountered");
- }
if (allow_errors) {
if (end_ptr_double > end_ptr_long && dval) {
#include <php.h>
#include <unicode/uchar.h>
-zend_uchar collator_is_numeric( UChar *str, int32_t length, zend_long *lval, double *dval, int allow_errors );
+zend_uchar collator_is_numeric( UChar *str, int32_t length, zend_long *lval, double *dval, bool allow_errors );
#endif // COLLATOR_IS_NUMERIC_H