php - how to backtrace default function arguments? -
function backtrace() { var_dump(debug_backtrace()); } function echosth($what = 'default text') { echo $what; backtrace(); } echosth('another text'); //argument shown // ["args"]=> array(1) {[0]=>&string(12) "another text"} echosth(); //it appears function has none arguments ["args"]=>array(0) {} is there way default value of parent function ?
using reflection
http://php.net/manual/en/reflectionparameter.getdefaultvalue.php
Comments
Post a Comment