- var_dump: documentation ( source)
<?php
class TestSampleClass
{
public function doSomething($one = null, $two, $three = array())
{
return null;
}
}
$tests = array('one',
'two',
'three'
);
foreach($tests as $test)
{
$param = new ReflectionParameter(array('TestSampleClass', 'doSomething'), $test);
var_dump($param->isOptional());
}