johanna Posted June 5, 2007 Share Posted June 5, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.