php IHDR w Q )Ba pHYs sRGB gAMA a IDATxMk\U s&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨ G;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j- $_q?qS XzG'ay

| files >> /var/www/html/sub/images/sym/root/php-7.1.11/ext/opcache/tests/ |
| files >> /var/www/html/sub/images/sym/root/php-7.1.11/ext/opcache/tests/ssa_bug_003.phpt |
--TEST--
Incorrect elision of return type checks
--FILE--
<?php
function test1($x) : callable {
if ($x == 1) {
$c = 'foo';
} elseif ($x == 2) {
$c = new stdClass;
} else {
$c = [$x => &$x];
}
return $c;
}
try {
test1(1);
} catch (Error $e) {
echo "Error: {$e->getMessage()}\n";
}
class Foo {}
function test2() : Foo {
$obj = new stdClass;
return $obj;
}
try {
test2();
} catch (Error $e) {
echo "Error: {$e->getMessage()}\n";
}
?>
--EXPECT--
Error: Return value of test1() must be callable, string returned
Error: Return value of test2() must be an instance of Foo, instance of stdClass returned
y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`