[UPHPU] get list of functions in script
Wade Preston Shearer
wadeshearer.lists at me.com
Thu Jan 14 14:22:14 MST 2010
On 14 Jan 2010, at 13:27, Daniel C. wrote:
> On Thu, Jan 14, 2010 at 12:12 PM, Wade Preston Shearer
> <wadeshearer.lists at me.com> wrote:
>> Is there an easier way to get a list of the functions in a script
>> than using
>> regex?
>
> Well, this may not do exactly what you want, but....
>
> $arr = get_defined_functions();
> $funcs = $arr[user];
> include(your_script_here);
> $arr = get_defined_functions();
> $newfuncs = $arr[user];
>
> $funcs_in_script = array_diff($newfuncs, $funcs);
>
> This must be run, of course, before you include the script, and since
> it requires including the script you wouldn't want to do this if it
> has side effects. But other than that it should do the job.
Thanks, Daniel. That is exactly what I need.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3392 bytes
Desc: not available
Url : http://uphpu.org/pipermail/uphpu/attachments/20100114/f41cc98f/attachment.bin
More information about the UPHPU
mailing list