print_r($a);
?>
--EXPECTF--
+Notice: Indirect modification of overloaded property A::$whatever has no effect in %sbug32660.php on line 20
A Object
(
- [q] => long
+ [q] => 3
)
+Notice: Indirect modification of overloaded property A::$whatever has no effect in %sbug32660.php on line 23
+
Fatal error: Cannot assign by reference to overloaded object in %sbug32660.php on line 23
--EXPECTF--
string(3) "bar"
-Notice: Undefined offset: 2 in %sbug37667.php on line %d
+Notice: Undefined offset: 2 in %sbug37667.php on line 16
NULL
object(Test)#%d (1) {
["property:protected"]=>
}
}
-Fatal error: Cannot use array returned from Test::__get('property') in write context in %sbug37667.php on line %d
+Notice: Indirect modification of overloaded property Test::$property has no effect in %sbug37667.php on line 20
+
+Notice: Indirect modification of overloaded property Test::$property has no effect in %sbug37667.php on line 21
+object(Test)#%d (1) {
+ ["property:protected"]=>
+ array(1) {
+ ["foo"]=>
+ string(3) "bar"
+ }
+}
+===DONE===
if (rv) {
retval = &rv;
+ if ((type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET) && rv->refcount > 0) {
+ zval *tmp = rv;
+
+ ALLOC_ZVAL(rv);
+ *rv = *tmp;
+ zval_copy_ctor(rv);
+ rv->is_ref = 0;
+ rv->refcount = 0;
+ if (Z_TYPE_P(rv) != IS_OBJECT) {
+ zend_error(E_NOTICE, "Indirect modification of overloaded property %s::$%s has no effect", zobj->ce->name, Z_STRVAL_P(member));
+ }
+ }
} else {
retval = &EG(uninitialized_zval_ptr);
}
zval_ptr_dtor(&tmp_member);
(*retval)->refcount--;
}
- if (*retval && (type == BP_VAR_W || type == BP_VAR_RW) && Z_TYPE_PP(retval) == IS_ARRAY) {
- zend_error(E_ERROR, "Cannot use array returned from %s::__get('%s') in write context", zobj->ce->name, Z_STRVAL_P(member));
- }
+// if (*retval && (type == BP_VAR_W || type == BP_VAR_RW) && Z_TYPE_PP(retval) == IS_ARRAY) {
+// zend_error(E_ERROR, "Cannot use array returned from %s::__get('%s') in write context", zobj->ce->name, Z_STRVAL_P(member));
+// }
return *retval;
}