cvs: ZendEngine2(PHP_5_0) / zend_execute.c /tests bug31098.phpt

From: Date: Fri, 14 Jan 2005 08:50:00 +0000
Subject: cvs: ZendEngine2(PHP_5_0) / zend_execute.c /tests bug31098.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-3293@lists.php.net to get a copy of this message
dmitry Fri Jan 14 03:50:00 2005 EDT Modified files: (Branch: PHP_5_0) /ZendEngine2 zend_execute.c /ZendEngine2/tests bug31098.phpt Log: Revert to old behavior of $str["str"]. ($str["str"] is equivalent of $str[0]) http://cvs.php.net/diff.php/ZendEngine2/zend_execute.c?r1=1.652.2.15&r2=1.652.2.16&ty=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.652.2.15 ZendEngine2/zend_execute.c:1.652.2.16 --- ZendEngine2/zend_execute.c:1.652.2.15 Thu Jan 13 03:48:50 2005 +++ ZendEngine2/zend_execute.c Fri Jan 14 03:49:58 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.652.2.15 2005/01/13 08:48:50 dmitry Exp $ */ +/* $Id: zend_execute.c,v 1.652.2.16 2005/01/14 08:49:58 dmitry Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -967,24 +967,7 @@ offset = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R); - if (Z_TYPE_P(offset) == IS_STRING) { - char *strval; - long lval; - - strval = Z_STRVAL_P(offset); - if (is_numeric_string(strval, Z_STRLEN_P(offset), &lval, NULL, 0) == IS_LONG) { - ZVAL_LONG(&tmp, lval); - offset = &tmp; - } else { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get string index from a string"); - } - *retval = &EG(error_zval_ptr);; - SELECTIVE_PZVAL_LOCK(**retval, result); - FREE_OP(Ts, op2, EG(free_op2)); - return; - } - } else if (offset->type != IS_LONG) { + if (offset->type != IS_LONG) { tmp = *offset; zval_copy_ctor(&tmp); convert_to_long(&tmp); @@ -4052,16 +4035,7 @@ } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ zval tmp; - if (Z_TYPE_P(offset) == IS_STRING) { - char *strval; - long lval; - - strval = Z_STRVAL_P(offset); - if (is_numeric_string(strval, Z_STRLEN_P(offset), &lval, NULL, 0) == IS_LONG) { - ZVAL_LONG(&tmp, lval); - offset = &tmp; - } - } else if (offset->type != IS_LONG) { + if (offset->type != IS_LONG) { tmp = *offset; zval_copy_ctor(&tmp); convert_to_long(&tmp); http://cvs.php.net/diff.php/ZendEngine2/tests/bug31098.phpt?r1=1.1.2.2&r2=1.1.2.3&ty=u Index: ZendEngine2/tests/bug31098.phpt diff -u ZendEngine2/tests/bug31098.phpt:1.1.2.2 ZendEngine2/tests/bug31098.phpt:1.1.2.3 --- ZendEngine2/tests/bug31098.phpt:1.1.2.2 Wed Jan 12 04:17:45 2005 +++ ZendEngine2/tests/bug31098.phpt Fri Jan 14 03:50:00 2005 @@ -17,7 +17,7 @@ $simpleString = "Bogus String Text"; echo isset($simpleString->wrong)?"bug\n":"ok\n"; -echo isset($simpleString["wrong"])?"bug\n":"ok\n"; +echo isset($simpleString["wrong"])?"ok\n":"bug\n"; echo isset($simpleString[-1])?"bug\n":"ok\n"; echo isset($simpleString[0])?"ok\n":"bug\n"; echo isset($simpleString["0"])?"ok\n":"bug\n"; @@ -25,18 +25,18 @@ echo isset($simpleString["17"])?"bug\n":"ok\n"; echo isset($simpleString["wrong"][0])?"bug\n":"ok\n"; echo $simpleString->wrong === null?"ok\n":"bug\n"; -echo $simpleString["wrong"] === null?"ok\n":"bug\n"; +echo $simpleString["wrong"] === "B"?"ok\n":"bug\n"; echo $simpleString["0"] === "B"?"ok\n":"bug\n"; $simpleString["wrong"] = "f"; -echo $simpleString["0"] === "B"?"ok\n":"bug\n"; +echo $simpleString["0"] === "f"?"ok\n":"bug\n"; ?> --EXPECTF-- bool(false) bool(false) bool(false) bool(false) -bool(false) -bool(false) +bool(true) +bool(true) ok ok ok @@ -46,12 +46,8 @@ ok ok -Notice: Trying to get property of non-object in %sbug31098.php on line %d +Notice: Trying to get property of non-object in /home/dmitry/php/php5.0/Zend/tests/bug31098.php on line 24 ok - -Notice: Trying to get string index from a string in %sbug31098.php on line %d ok ok - -Notice: Trying to get string index from a string in %sbug31098.php on line %d ok

« previous php.zend-engine.cvs (#3293) next »