0632fb3a11
It only matters for reflection, but hhas parameters with default values need to specify the text of the string. In addition, change reflection to report parameters with no default value string as not having a default value, to avoid crashing when trying to access it. Update the "func" parameter of array_filter to have a valid default. The other uses of defaults in array_map and array_filter are just to get the proper behavior on too few/too many args, and don't really correspond to default values.
12 linhas
212 B
PHP
12 linhas
212 B
PHP
<?php
|
|
|
|
function test() {
|
|
$x = new ReflectionFunction('array_filter');
|
|
$params = $x->getParameters();
|
|
$p1 = $params[1];
|
|
var_dump($p1->getDefaultValue());
|
|
var_dump($p1->getDefaultValueText());
|
|
}
|
|
|
|
test();
|