cvs: php-src /tests/lang bug28800.phpt ZendEngine2 zend_operators.h
| From: | Ilia Alshanetsky | Date: | Fri, 16 Jul 2004 02:03:25 +0000 |
| Subject: | cvs: php-src /tests/lang bug28800.phpt ZendEngine2 zend_operators.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-27846@lists.php.net to get a copy of this message | ||
iliaa Thu Jul 15 22:03:25 2004 EDT
Modified files:
/ZendEngine2 zend_operators.h
/php-src/tests/lang bug28800.phpt
Log:
MFB: Fixed bug #28800 (strings beginning with "inf" improperly converted).
http://cvs.php.net/diff.php/ZendEngine2/zend_operators.h?r1=1.88&r2=1.89&ty=u
Index: ZendEngine2/zend_operators.h
diff -u ZendEngine2/zend_operators.h:1.88 ZendEngine2/zend_operators.h:1.89
--- ZendEngine2/zend_operators.h:1.88 Sat Apr 3 06:09:39 2004
+++ ZendEngine2/zend_operators.h Thu Jul 15 22:03:25 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_operators.h,v 1.88 2004/04/03 11:09:39 andi Exp $ */
+/* $Id: zend_operators.h,v 1.89 2004/07/16 02:03:25 iliaa Exp $ */
#ifndef ZEND_OPERATORS_H
#define ZEND_OPERATORS_H
@@ -87,6 +87,8 @@
*lval = local_lval;
}
return IS_LONG;
+ } else if (end_ptr_long == str && *end_ptr_long != '\0') { /* ignore partial
string matches */
+ return 0;
}
} else {
end_ptr_long=NULL;
http://cvs.php.net/diff.php/php-src/tests/lang/bug28800.phpt?r1=1.1&r2=1.2&ty=u
Index: php-src/tests/lang/bug28800.phpt
diff -u /dev/null php-src/tests/lang/bug28800.phpt:1.2
--- /dev/null Thu Jul 15 22:03:25 2004
+++ php-src/tests/lang/bug28800.phpt Thu Jul 15 22:03:25 2004
@@ -0,0 +1,17 @@
+--TEST--
+Bug #28800 (Incorrect string to number conversion for strings starting with 'inf')
+--FILE--
+<?php
+ $strings = array('into', 'info', 'inf', 'infinity',
'infin', 'inflammable');
+ foreach ($strings as $v) {
+ echo ($v+0)."\n";
+ }
+?>
+--EXPECT--
+0
+0
+0
+0
+0
+0
+