nadeemshafi9 Posted February 24, 2009 Share Posted February 24, 2009 hi guys i just started using reflections and am having trouble invoking a method here is teh error Fatal error: Uncaught exception 'ReflectionException' with message 'Non-object passed to Invoke()' in C:\xampp\htdocs\blah\service.php:9 Stack trace: #0 C:\xampp\htdocs\rabbit\service.php(9): ReflectionMethod->invoke(NULL) #1 {main} thrown in C:\xampp\htdocs\blah\service.php on line 9 here is the code service.php?invoke=all (the method pronts "all") include("inc.services.php"); $invoke = $_GET['invoke']; $args = $_GET['args']; $method = new ReflectionMethod('Music', $invoke); var_dump($method->invoke(NULL)); any help much appreciated Link to comment https://forums.phpfreaks.com/topic/146725-solved-basic-reflections-method-invoke-help/ Share on other sites More sharing options...
nadeemshafi9 Posted February 24, 2009 Author Share Posted February 24, 2009 i worked it out the method has to be final public static Link to comment https://forums.phpfreaks.com/topic/146725-solved-basic-reflections-method-invoke-help/#findComment-770313 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.