summaryrefslogtreecommitdiff
path: root/Zend/tests/bug70117.phpt
blob: 51b77457ab06361302d5a3884cccaeb6b223dc06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--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"