Created
February 25, 2019 19:05
-
-
Save basz/fa32972fdc4fcd0466fb1d0025a4b736 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function methodThief($object, $method, array $arg = []) | |
{ | |
$value = \Closure::bind(function () use ($method, $arg) { | |
return $this->$method(...$arg); | |
}, $object, $object)->__invoke(); | |
return $value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment