mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00

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.
20 lines
455 B
PHP
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)
|