php-src/ext/reflection/tests/ReflectionClass_isArray.phpt
Nikita Popov 3b08f53c97 Deprecate required param after optional
As an exception, we allow "Type $foo = null" to occur before a
required parameter, because this pattern was used as a replacement
for nullable types in PHP versions older than 7.1.

Closes GH-5067.
2020-02-18 14:35:58 +01:00

20 lines
455 B
PHP

--TEST--
public bool ReflectionParameter::isArray ( void );
--CREDITS--
marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br
--FILE--
<?php
function testReflectionIsArray(array $a, ?array $b, iterable $c, array|string $d) {}
$reflection = new ReflectionFunction('testReflectionIsArray');
foreach ($reflection->getParameters() as $parameter) {
var_dump($parameter->isArray());
}
?>
--EXPECT--
bool(true)
bool(true)
bool(false)
bool(false)