PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Apr 2006, PHP 5.1.3
+- Fixed bug #37046 (foreach breaks static scope). (Dmitry)
- Fixed bug #37002 (Have to quote literals in INI when concatenating with
- vars). (Dmitry)
+ vars). (Dmitry)
06 Apr 2006, PHP 5.1.3RC3
- Eliminated run-time constant fetching for TRUE, FALSE and NULL. (Dmitry)
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
} else {
- array_ptr->refcount++;
+ if (OP1_TYPE == IS_VAR &&
+ free_op1.var == NULL &&
+ !array_ptr->is_ref &&
+ array_ptr->refcount > 1) {
+ /* non-separated return value from function */
+ zval *tmp;
+
+ ALLOC_ZVAL(tmp);
+ INIT_PZVAL_COPY(tmp, array_ptr);
+ zval_copy_ctor(tmp);
+ array_ptr = tmp;
+ } else {
+ array_ptr->refcount++;
+ }
}
}
static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+ zend_free_op free_op1;
zval *array_ptr, **array_ptr_ptr;
HashTable *fe_ht;
zend_object_iterator *iter = NULL;
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
} else {
- array_ptr->refcount++;
+ if (IS_CONST == IS_VAR &&
+ free_op1.var == NULL &&
+ !array_ptr->is_ref &&
+ array_ptr->refcount > 1) {
+ /* non-separated return value from function */
+ zval *tmp;
+
+ ALLOC_ZVAL(tmp);
+ INIT_PZVAL_COPY(tmp, array_ptr);
+ zval_copy_ctor(tmp);
+ array_ptr = tmp;
+ } else {
+ array_ptr->refcount++;
+ }
}
}
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
} else {
- array_ptr->refcount++;
+ if (IS_TMP_VAR == IS_VAR &&
+ free_op1.var == NULL &&
+ !array_ptr->is_ref &&
+ array_ptr->refcount > 1) {
+ /* non-separated return value from function */
+ zval *tmp;
+
+ ALLOC_ZVAL(tmp);
+ INIT_PZVAL_COPY(tmp, array_ptr);
+ zval_copy_ctor(tmp);
+ array_ptr = tmp;
+ } else {
+ array_ptr->refcount++;
+ }
}
}
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
} else {
- array_ptr->refcount++;
+ if (IS_VAR == IS_VAR &&
+ free_op1.var == NULL &&
+ !array_ptr->is_ref &&
+ array_ptr->refcount > 1) {
+ /* non-separated return value from function */
+ zval *tmp;
+
+ ALLOC_ZVAL(tmp);
+ INIT_PZVAL_COPY(tmp, array_ptr);
+ zval_copy_ctor(tmp);
+ array_ptr = tmp;
+ } else {
+ array_ptr->refcount++;
+ }
}
}
static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+ zend_free_op free_op1;
zval *array_ptr, **array_ptr_ptr;
HashTable *fe_ht;
zend_object_iterator *iter = NULL;
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
} else {
- array_ptr->refcount++;
+ if (IS_CV == IS_VAR &&
+ free_op1.var == NULL &&
+ !array_ptr->is_ref &&
+ array_ptr->refcount > 1) {
+ /* non-separated return value from function */
+ zval *tmp;
+
+ ALLOC_ZVAL(tmp);
+ INIT_PZVAL_COPY(tmp, array_ptr);
+ zval_copy_ctor(tmp);
+ array_ptr = tmp;
+ } else {
+ array_ptr->refcount++;
+ }
}
}