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. Quote Link to comment https://forums.phpfreaks.com/topic/54238-inspectgetargspec-for-php/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.