large amount of data) (CVE-2010-3710). (Adam)
- Fixed ReflectionProperty::isDefault() giving a wrong result for properties
obtained with ReflectionClass::getProperties(). (Gustavo)
+- Fixed covariance of return-by-ref constraints. (Etienne)
- Fixed bug #53198 (changing INI setting "from" with ini_set did not have any
effect). (Gustavo)
--- /dev/null
+--TEST--
+Covariant return-by-ref constraints
+--FILE--
+<?php
+
+class A implements ArrayAccess {
+ public $foo = array();
+
+ public function &offsetGet($n) {
+ return $this->foo[$n];
+ }
+
+ public function offsetSet($n, $v) {
+ }
+ public function offsetUnset($n) {
+ }
+ public function offsetExists($n) {
+ }
+}
+
+$a = new A;
+
+$a['foo']['bar'] = 2;
+
+var_dump($a);
+
+?>
+==DONE==
+--EXPECTF--
+object(A)#1 (1) {
+ ["foo"]=>
+ array(1) {
+ ["foo"]=>
+ array(1) {
+ ["bar"]=>
+ int(2)
+ }
+ }
+}
+==DONE==
return 0;
}
- if (fe->common.return_reference != proto->common.return_reference) {
+ /* by-ref constraints on return values are covariant */
+ if (proto->common.return_reference && !fe->common.return_reference) {
return 0;
}
/* Only one has an array type hint and the other one doesn't */
return 0;
}
+
+ /* by-ref constraints on arguments are invariant */
if (fe->common.arg_info[i].pass_by_reference != proto->common.arg_info[i].pass_by_reference) {
return 0;
}