Arquivos
hhvm/hphp/test/slow/reflection/hhas_defaults.php
T
mwilliams 0632fb3a11 Allow .hhas to specify default values
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.
2013-06-27 10:50:22 -07:00

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();