mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Currently, this fails because the type is IS_REFERENCE instead of IS_ARRAY, but this could be confusing because a function return value is normally dereferenced automatically in a lot of cases. Closes GH-18762.
23 lines
265 B
PHP
23 lines
265 B
PHP
--TEST--
|
|
__debugInfo with reference return
|
|
--FILE--
|
|
<?php
|
|
|
|
class Test {
|
|
private $tmp = ['x' => 1];
|
|
|
|
public function &__debugInfo(): array
|
|
{
|
|
return $this->tmp;
|
|
}
|
|
}
|
|
|
|
var_dump(new Test);
|
|
|
|
?>
|
|
--EXPECT--
|
|
object(Test)#1 (1) {
|
|
["x"]=>
|
|
int(1)
|
|
}
|