Last active
December 5, 2020 16:46
-
-
Save windbridges/1f3ab322ab0c8909b684d767da10dfc5 to your computer and use it in GitHub Desktop.
Checks if function is also a generator
This file contains hidden or 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
<?php | |
function isGenerator (callable $handler) | |
{ | |
$r = new ReflectionFunction($handler); | |
return $r->isGenerator(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment