1--TEST--
2DNF types for internal functions
3--EXTENSIONS--
4zend_test
5spl
6reflection
7--FILE--
8<?php
9
10$rf = new \ReflectionFunction('zend_test_internal_dnf_arguments');
11var_dump((string)$rf->getReturnType());
12$paramType = $rf->getParameters()[0]->getType();
13var_dump((string)$paramType);
14
15try {
16    zend_test_internal_dnf_arguments(new stdClass);
17} catch (\Throwable $err) {
18    echo $err->getMessage(), "\n";
19}
20
21$obj = new \ArrayIterator([]);
22$result = zend_test_internal_dnf_arguments($obj);
23var_dump($result);
24
25?>
26--EXPECT--
27string(32) "Iterator|(Traversable&Countable)"
28string(32) "Iterator|(Traversable&Countable)"
29zend_test_internal_dnf_arguments(): Argument #1 ($arg) must be of type Iterator|(Traversable&Countable), stdClass given
30object(ArrayIterator)#5 (1) {
31  ["storage":"ArrayIterator":private]=>
32  array(0) {
33  }
34}
35