Guest User

Untitled

a guest
Jan 19th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. Function (Index())->Index() does not exist
  2.  
  3. ReflectionMethod Object
  4. (
  5. [name] => Index
  6. [class] => Index
  7. )
  8.  
  9. $call = new ReflectionMethod( "ExampleClass", "exampleMethod" );
  10. $call->invokeArgs( new ExampleClass(), ["argument1", "argument2"] );
  11. print_r( $call );
  12.  
  13. $type = 'ExampleClass';
  14.  
  15. $reflector = new ReflectionClass( $type );
  16.  
  17. if ( !$reflector->isInstantiable() )
  18. throw new Exception( "Resolution target [$type] is not instantiable." );
  19.  
  20. $constructor = $reflector->getConstructor();
  21.  
  22. $parameters = $constructor->getParameters();
  23.  
  24. $call = new ReflectionMethod( "ExampleClass", "exampleMethod" );
  25. $call->invokeArgs( new ExampleClass(), ["argument1", "argument2"] );
  26.  
  27. Argument 1: argument1
  28. Argument 2: argument2
Add Comment
Please, Sign In to add comment