Help me find all the arguments to the funcname function using the token_get_all () function in the source code. It sounds simple, but there are many special options, such as arrays as parameters or calling static methods as parameters. Maybe there is a simple universal solution?
UPD:
I need function arguments passed when you call this. Get them for external file analysis. For example, there is a php file:
<?php
funcname('foo');
funcname(array('foo'), 'bar');
The analyzer should start as follows:
$source = file_get_contents('source.php');
$tokens = token_get_all($source);
...
As a result, you need to get a list like this:
[0] => array('foo'),
[1] => array(array('foo'), 'bar')
source
share