Skip to content

Instantly share code, notes, and snippets.

@hannesvdvreken
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hannesvdvreken/ea9666c659685f7c69f9 to your computer and use it in GitHub Desktop.
Save hannesvdvreken/ea9666c659685f7c69f9 to your computer and use it in GitHub Desktop.
$callables = [
'Class::staticMethodName',
'\Namespace\method_name',
[$object, 'methodName'],
function (\Vendor\Dependency $object) {...},
];
// This will work for every item in the array
foreach ($callables as $callable) {
call_user_func($callable);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment