1--TEST-- 2Bug #70117 (Unexpected return type error) 3--FILE-- 4<?php 5 6function &foo() :string { 7 $a = array(1); 8 $b = &$a[0]; 9 return $b; 10} 11 12function &foo1() :string { 13 $a = array("ref"); 14 return $a[0]; 15} 16 17var_dump(foo()); 18var_dump(foo1()); 19--EXPECT-- 20string(1) "1" 21string(3) "ref" 22