cvs: ZendEngine2 / zend_execute.c zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h /tests bug31098.phpt

From: Date: Fri, 14 Jan 2005 09:01:23 +0000
Subject: cvs: ZendEngine2 / zend_execute.c zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h /tests bug31098.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-3291@lists.php.net to get a copy of this message
dmitry Fri Jan 14 04:01:23 2005 EDT Modified files: /ZendEngine2 zend_execute.c zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h /ZendEngine2/tests bug31098.phpt Log: Restore behavior of $str["str"]. (Now $str["str"] is equivalent to $str[0] again)

http://cvs.php.net/diff.php/ZendEngine2/zend_execute.c?r1=1.689&r2=1.690&ty=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.689 ZendEngine2/zend_execute.c:1.690 --- ZendEngine2/zend_execute.c:1.689 Thu Jan 13 03:49:06 2005 +++ ZendEngine2/zend_execute.c Fri Jan 14 04:01:21 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.689 2005/01/13 08:49:06 dmitry Exp $ */ +/* $Id: zend_execute.c,v 1.690 2005/01/14 09:01:21 dmitry Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -1190,28 +1190,7 @@ zend_error_noreturn(E_ERROR, "[] operator not supported for strings"); } - if (Z_TYPE_P(dim) == IS_STRING) { - char *strval; - long lval; - - strval = Z_STRVAL_P(dim); - if (is_numeric_string(strval, Z_STRLEN_P(dim), &lval, NULL, 0) == IS_LONG) { - ZVAL_LONG(&tmp, lval); - dim = &tmp; - } else { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get string index from a string"); - } - if (result) { - result->var.ptr_ptr = &EG(error_zval_ptr); - PZVAL_LOCK(*result->var.ptr_ptr); - if (type == BP_VAR_R || type == BP_VAR_IS) { - AI_USE_PTR(result->var); - } - } - return; - } - } else if (dim->type != IS_LONG) { + if (dim->type != IS_LONG) { tmp = *dim; zval_copy_ctor(&tmp); convert_to_long(&tmp); http://cvs.php.net/diff.php/ZendEngine2/zend_vm_def.h?r1=1.8&r2=1.9&ty=u Index: ZendEngine2/zend_vm_def.h diff -u ZendEngine2/zend_vm_def.h:1.8 ZendEngine2/zend_vm_def.h:1.9 --- ZendEngine2/zend_vm_def.h:1.8 Wed Jan 12 04:18:30 2005 +++ ZendEngine2/zend_vm_def.h Fri Jan 14 04:01:21 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_def.h,v 1.8 2005/01/12 09:18:30 dmitry Exp $ */ +/* $Id: zend_vm_def.h,v 1.9 2005/01/14 09:01:21 dmitry Exp $ */ ZEND_VM_HANDLER(1, ZEND_ADD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) { @@ -3193,16 +3193,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/zend_vm_execute.h?r1=1.10&r2=1.11&ty=u Index: ZendEngine2/zend_vm_execute.h diff -u ZendEngine2/zend_vm_execute.h:1.10 ZendEngine2/zend_vm_execute.h:1.11 --- ZendEngine2/zend_vm_execute.h:1.10 Wed Jan 12 04:18:30 2005 +++ ZendEngine2/zend_vm_execute.h Fri Jan 14 04:01:22 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_execute.h,v 1.10 2005/01/12 09:18:30 dmitry Exp $ */ +/* $Id: zend_vm_execute.h,v 1.11 2005/01/14 09:01:22 dmitry Exp $ */ #define ZEND_VM_CONTINUE() return 0 @@ -9013,16 +9013,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); @@ -10337,16 +10328,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); @@ -11682,16 +11664,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); @@ -13157,16 +13130,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); @@ -14232,16 +14196,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); @@ -15190,16 +15145,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); @@ -16148,16 +16094,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); @@ -17225,16 +17162,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); @@ -19719,16 +19647,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); @@ -21043,16 +20962,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); @@ -22388,16 +22298,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); @@ -23863,16 +23764,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); @@ -30938,16 +30830,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/zend_vm_opcodes.h?r1=1.3&r2=1.4&ty=u Index: ZendEngine2/zend_vm_opcodes.h diff -u ZendEngine2/zend_vm_opcodes.h:1.3 ZendEngine2/zend_vm_opcodes.h:1.4 --- ZendEngine2/zend_vm_opcodes.h:1.3 Wed Jan 12 04:18:31 2005 +++ ZendEngine2/zend_vm_opcodes.h Fri Jan 14 04:01:22 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_opcodes.h,v 1.3 2005/01/12 09:18:31 dmitry Exp $ */ +/* $Id: zend_vm_opcodes.h,v 1.4 2005/01/14 09:01:22 dmitry Exp $ */ #define ZEND_NOP 0 #define ZEND_ADD 1 http://cvs.php.net/diff.php/ZendEngine2/tests/bug31098.phpt?r1=1.2&r2=1.3&ty=u Index: ZendEngine2/tests/bug31098.phpt diff -u ZendEngine2/tests/bug31098.phpt:1.2 ZendEngine2/tests/bug31098.phpt:1.3 --- ZendEngine2/tests/bug31098.phpt:1.2 Wed Jan 12 04:18:31 2005 +++ ZendEngine2/tests/bug31098.phpt Fri Jan 14 04:01:22 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 @@ -48,10 +48,6 @@ Notice: Trying to get property of non-object in %sbug31098.php on line %d 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 (#3291) next »