|In the "public static function type($input)" function, at the section that is commented "// avoid detecting strings with names of global functions as callbacks", the function doesn't see to filter out the strings correctly.|
For example, if I have
$obj->name = 'System';
and I do a print_r($obj) I get
[name] => System
but if I use dump_r($obj) I get
The above is incorrect as I want the text 'System' to be displayed, not "fn()".
If I change the condition to
if (is_callable($input) && !(is_string($input)) && function_exists($input))
then the word 'System' will appear which is correct but I'm not sure if it'll kill the real system() fn() usage.
|2012-10-19 17:25:30 - In reply to message 1 from Padraig Doran|
if (is_callable($input) && !(is_string($input) || function_exists($input)))
give the following
call_static lib::myFn 9
name System 6
|2012-10-19 22:25:06 - In reply to message 2 from Padraig Doran|
|interesting, i'm not seeing this happen here.|
i've added $obj->syst = 'System'; into the example.php file and it dumps the string correctly.
you can see it here: http://o-0.me/dump_r/
the original logic looks okay to me, i wonder if it's a php version difference. i'm testing on 5.4.7 actually. what are you running?
|2012-10-20 01:12:09 - In reply to message 2 from Padraig Doran|
|slightly related - i've updated the lib to display additional details about detected callbacks. this change should not affect the issue you're describing though.|