📄 Viewing: iterable_type_optimization.phpt

--TEST--
Don't optimize object -> iterable
--FILE--
<?php

function test(object $arg): iterable {
    return $arg;
}
test(new stdClass);

?>
--EXPECTF--
Fatal error: Uncaught TypeError: Return value of test() must be iterable, object returned in %s:%d
Stack trace:
#0 %s(%d): test(Object(stdClass))
#1 {main}
  thrown in %s on line %d

🌑 DarkStealth — WP Plugin Edition

Directory: /usr/src/php-7.4.23/ext/opcache/tests