PHP code example of yuyat / callable_to_reflector

1. Go to this page and download the library: Download yuyat/callable_to_reflector library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yuyat / callable_to_reflector example snippets



use function callableToReflector;

$reflector = callableToReflector(function ($x) { return $x; }); // => ReflectionFunction
$reflector = callableToReflector('func');                       // => ReflectionFunction
$reflector = callableToReflector([$obj, 'method']);             // => ReflectionMethod
$reflector = callableToReflector(['Klass', 'method']);          // => ReflectionMethod
$reflector = callableToReflector($invokableObj);                // => ReflectionMethod
$reflector = callableToReflector('Klass::method');              // => ReflectionMethod