nadeemshafi9 Posted February 24, 2009 Share Posted February 24, 2009 hi guys im trying to pass an argument to my method using reflections but it says Warning: Missing argument 1 for Music::byTitle() in C:\xampp\htdocs\x\inc.services.php on line 8 here is my service HTTP handler include("inc.services.php"); //$invoke = $_GET['invoke']; $args = $_GET['args']; $method = new ReflectionMethod('Music', 'all'); $method->invoke(NULL); $method = new ReflectionMethod('Music', 'byTitle'); $method->invoke($args); here is the service class itself class Music { function Music(){ } final public static function all(){ echo "method all<br>"; } final public static function byTitle($args){ echo "method byTitle<br>"; } } any help much appreciated Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted February 24, 2009 Author Share Posted February 24, 2009 i figured it out its $method->invoke('Music', $args); Quote Link to comment Share on other sites More sharing options...
rhodesa Posted February 24, 2009 Share Posted February 24, 2009 what are you trying to accomplish with this? Quote Link to comment 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.