1--TEST-- 2return type with finally 3--INI-- 4opcache.enable=0 5--FILE-- 6<?php 7 8function foo() : array { 9 try { 10 throw new Exception("xxxx"); 11 } finally { 12 return null; 13 } 14} 15 16foo(); 17?> 18--EXPECTF-- 19Fatal error: Uncaught Exception: xxxx in %s:%d 20Stack trace: 21#0 %s(%d): foo() 22#1 {main} 23 24Next TypeError: Return value of foo() must be of the type array, null returned in %s29.php:%d 25Stack trace: 26#0 %s(%d): foo() 27#1 {main} 28 thrown in %s029.php on line %d 29