Jump to content

inspect.getargspec() for PHP


johanna

Recommended Posts

Does anyone know if there is already something similar to inspect.getargspec() for PHP? or has anyone written anything?

 

essentially, this is what I need. Say you have a function:

 

function foo($A, $B, C='4'){

return "got it";

}

 

I need to find out what the arguments are named. In this case it is "$A" and "$B" and "$C" (or ideally $C = '4').

 

In C you can do something along these lines...

 

In Python, you can do it with getargspec(function_name) ... Here's an example:

 

>>> import inspect
>>> def foo(A, B, C=100):
... pass
...
>>> inspect.getargspec(foo)
(['A', 'B', 'C'], None, None, (100,))

 

Anyone ever make such an extension or function for PHP and willing to share? Or if anyone has pointers.

 

Link to comment
https://forums.phpfreaks.com/topic/54238-inspectgetargspec-for-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.