mirror of
https://github.com/php/php-src.git
synced 2024-12-18 14:30:35 +08:00
a555cc0b3d
Remove most of the `===DONE===` tags and its variations. Keep `===DONE===` if the test output otherwise becomes empty. Closes GH-4872.
39 lines
513 B
PHP
39 lines
513 B
PHP
--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);
|
|
|
|
?>
|
|
--EXPECT--
|
|
object(A)#1 (1) {
|
|
["foo"]=>
|
|
array(1) {
|
|
["foo"]=>
|
|
array(1) {
|
|
["bar"]=>
|
|
int(2)
|
|
}
|
|
}
|
|
}
|