mirror of
https://github.com/php/php-src.git
synced 2024-12-16 05:15:03 +08:00
7aacc705d0
Closes GH-5958
23 lines
297 B
PHP
23 lines
297 B
PHP
--TEST--
|
|
Bug #70117 (Unexpected return type error)
|
|
--FILE--
|
|
<?php
|
|
|
|
function &foo() :string {
|
|
$a = array(1);
|
|
$b = &$a[0];
|
|
return $b;
|
|
}
|
|
|
|
function &foo1() :string {
|
|
$a = array("ref");
|
|
return $a[0];
|
|
}
|
|
|
|
var_dump(foo());
|
|
var_dump(foo1());
|
|
?>
|
|
--EXPECT--
|
|
string(1) "1"
|
|
string(3) "ref"
|