From: Stanislav Malyshev Date: Tue, 14 Nov 2000 18:33:58 +0000 (+0000) Subject: Restore compatibility with old broken way X-Git-Tag: php-4.0.4RC3~197 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d57a5b2a4f212cb528fbf23798a717580ee456c;p=php Restore compatibility with old broken way --- diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index b537c08141..c71d05e779 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -1018,10 +1018,16 @@ ANY_CHAR (.|[\n]) errno = 0; zendlval->value.lval = strtoul(yytext, NULL, 16); if (errno == ERANGE) { /* overflow */ - /* not trying strtod - it returns trans on 0x-es */ + /* not trying strtod - it returns trash on 0x-es */ zendlval->value.lval = LONG_MAX; /* maximal long */ zend_error(E_NOTICE,"Hex number is too big: %s",yytext); } else { + if(zendlval->value.lval < 0) { + /* maintain consistency with the old way */ + zendlval->value.dval = (unsigned long) zendlval->value.lval; + zendlval->type = IS_DOUBLE; + return T_DNUMBER; + } zendlval->type = IS_LONG; } zendlval->type = IS_LONG;