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