specially compiled functions). (Majkl578)
. Fixed bug #76430 (__METHOD__ inconsistent outside of method).
(Ryan McCullagh, Nikita)
+ . Fixed bug #75921 (Inconsistent: No warning in some cases when stdObj is
+ created on the fly). (David Walker)
- CURL:
. Fixed bug #76480 (Use curl_multi_wait() so that timeouts are respected).
Warning: Creating default object from empty value in %sbug52041.php on line 7
+Warning: Creating default object from empty value in %sbug52041.php on line 7
+
Notice: Undefined variable: x in %sbug52041.php on line 3
Warning: Creating default object from empty value in %sbug52041.php on line 8
Notice: Undefined variable: x in %sbug52041.php on line 3
+Warning: Creating default object from empty value in %sbug52041.php on line 9
+
Notice: Undefined property: stdClass::$a in %sbug52041.php on line 9
Warning: Creating default object from empty value in %sbug52041.php on line 9
Notice: Undefined variable: x in %sbug52041.php on line 3
+Warning: Creating default object from empty value in %sbug52041.php on line 11
+
Notice: Undefined property: stdClass::$a in %sbug52041.php on line 11
Warning: Creating default object from empty value in %sbug52041.php on line 11
$array[0] = 42;
var_dump($array);
?>
---EXPECT--
+--EXPECTF--
+Warning: Creating default object from empty value in %sbug71539_5.php on line 3
array(2) {
[0]=>
&int(42)
--- /dev/null
+--TEST--
+Bug #75921: Inconsistent error when creating stdObject from empty variable
+--FILE--
+<?php
+
+$null->a = 42;
+var_dump($null);
+unset($null);
+
+$null->a['hello'] = 42;
+var_dump($null);
+unset($null);
+
+$null->a->b = 42;
+var_dump($null);
+unset($null);
+
+$null->a['hello']->b = 42;
+var_dump($null);
+unset($null);
+
+$null->a->b['hello'] = 42;
+var_dump($null);
+unset($null);
+
+?>
+--EXPECTF--
+Warning: Creating default object from empty value in %sbug75921.php on line 3
+object(stdClass)#1 (1) {
+ ["a"]=>
+ int(42)
+}
+
+Warning: Creating default object from empty value in %sbug75921.php on line 7
+object(stdClass)#1 (1) {
+ ["a"]=>
+ array(1) {
+ ["hello"]=>
+ int(42)
+ }
+}
+
+Warning: Creating default object from empty value in %sbug75921.php on line 11
+
+Warning: Creating default object from empty value in %sbug75921.php on line 11
+object(stdClass)#1 (1) {
+ ["a"]=>
+ object(stdClass)#2 (1) {
+ ["b"]=>
+ int(42)
+ }
+}
+
+Warning: Creating default object from empty value in %sbug75921.php on line 15
+
+Warning: Creating default object from empty value in %sbug75921.php on line 15
+object(stdClass)#1 (1) {
+ ["a"]=>
+ array(1) {
+ ["hello"]=>
+ object(stdClass)#2 (1) {
+ ["b"]=>
+ int(42)
+ }
+ }
+}
+
+Warning: Creating default object from empty value in %sbug75921.php on line 19
+
+Warning: Creating default object from empty value in %sbug75921.php on line 19
+object(stdClass)#1 (1) {
+ ["a"]=>
+ object(stdClass)#2 (1) {
+ ["b"]=>
+ array(1) {
+ ["hello"]=>
+ int(42)
+ }
+ }
+}
?>
--EXPECTF--
+Warning: Creating default object from empty value in %sobjects_020.php on line 7
object(stdClass)#%d (2) {
["a"]=>
*RECURSION*
Warning: Creating default object from empty value in %s on line %d
+Warning: Creating default object from empty value in %s on line %d
+
+Warning: Creating default object from empty value in %s on line %d
+
Warning: Creating default object from empty value in %s on line %d
object(Test)#3 (3) {
["prop"]=>
|| opline->opcode == ZEND_POST_INC_OBJ
|| opline->opcode == ZEND_POST_DEC_OBJ) {
zend_error(E_WARNING, "Attempt to increment/decrement property '%s' of non-object", ZSTR_VAL(property_name));
+ } else if (opline->opcode == ZEND_FETCH_OBJ_W
+ || opline->opcode == ZEND_FETCH_OBJ_RW
+ || opline->opcode == ZEND_ASSIGN_OBJ_REF) {
+ zend_error(E_WARNING, "Attempt to modify property '%s' of non-object", ZSTR_VAL(property_name));
} else {
zend_error(E_WARNING, "Attempt to assign property '%s' of non-object", ZSTR_VAL(property_name));
}
return object;
}
-static zend_never_inline ZEND_COLD zval* ZEND_FASTCALL make_real_object_rw(zval *object, zval *property OPLINE_DC)
-{
- zval *ref = NULL;
- if (Z_ISREF_P(object)) {
- ref = object;
- object = Z_REFVAL_P(object);
- }
-
- if (UNEXPECTED(Z_TYPE_P(object) > IS_FALSE &&
- (Z_TYPE_P(object) != IS_STRING || Z_STRLEN_P(object) != 0))) {
- if (opline->op1_type != IS_VAR || EXPECTED(!Z_ISERROR_P(object))) {
- zend_string *tmp_property_name;
- zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name);
- zend_error(E_WARNING, "Attempt to modify property '%s' of non-object", ZSTR_VAL(property_name));
- zend_tmp_string_release(tmp_property_name);
- }
- return NULL;
- }
-
- if (ref) {
- zend_property_info *error_prop = i_zend_check_ref_stdClass_assignable(Z_REF_P(ref));
- if (error_prop) {
- zend_throw_auto_init_in_ref_error(error_prop, "stdClass");
- return NULL;
- }
- }
-
- zval_ptr_dtor_nogc(object);
- object_init(object);
- return object;
-}
-
static ZEND_COLD void zend_verify_type_error_common(
const zend_function *zf, const zend_arg_info *arg_info,
const zend_class_entry *ce, zval *value,
return;
}
- container = make_real_object_rw(container, prop_ptr OPLINE_CC);
+ container = make_real_object(container, prop_ptr OPLINE_CC);
if (UNEXPECTED(!container)) {
ZVAL_ERROR(result);
return;
</c_fpobel>
EOD;
-$xml = simplexml_load_string ($xml_str) ;
+$xml = simplexml_load_string($xml_str);
$val = 1;
var_dump($val);
$zml->pos["act_idx"] = $val;
-var_dump($val) ;
+var_dump($val);
?>
===DONE===
---EXPECT--
+--EXPECTF--
int(1)
+
+Warning: Creating default object from empty value in %sbug36611.php on line 17
int(1)
===DONE===
good
$i->p->q=f():
Warning: Creating default object from empty value in %s on line %d
+
+Warning: Creating default object from empty value in %s on line %d
+good
+$i->p[0]=f():
+Warning: Creating default object from empty value in %s on line %d
good
-$i->p[0]=f(): good
$i->p[0]->p=f():
+Warning: Creating default object from empty value in %s on line %d
+
Warning: Creating default object from empty value in %s on line %d
good
C::$p=f(): good
$a->b->c
+Warning: Creating default object from empty value in %s on line %d
+
Warning: Creating default object from empty value in %s on line %d
array(1) {
[0]=>
}
$a->b[0]
+
+Warning: Creating default object from empty value in %s on line %d
array(1) {
[0]=>
string(8) "original"
}
$a->b[0][0]
+
+Warning: Creating default object from empty value in %s on line %d
array(1) {
[0]=>
string(8) "original"
$a->b[0]->c
+Warning: Creating default object from empty value in %s on line %d
+
Warning: Creating default object from empty value in %s on line %d
array(1) {
[0]=>
?>
--EXPECTF--
---- Pass uninitialised array & object by ref: function call ---
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
array(1) {
[0]=>
string(12) "Ref1 changed"
---- Pass uninitialised arrays & objects by ref: static method call ---
Deprecated: Non-static method C::refs() should not be called statically in %s on line 39
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
array(1) {
[0]=>
string(12) "Ref1 changed"
---- Pass uninitialised arrays & objects by ref: constructor ---
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
array(1) {
[0]=>
string(12) "Ref1 changed"
}
---- Pass uninitialised arrays & objects by ref: instance method call ---
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
+
+Warning: Creating default object from empty value in %spassByReference_006.php on line %d
array(1) {
[0]=>
string(12) "Ref1 changed"