note 127999 added to reflectionfunction.isanonymous
| From: | TaufikNurrohman at main dot php dot net | Date: | Fri, 09 Dec 2022 11:22:00 +0000 |
| Subject: | note 127999 added to reflectionfunction.isanonymous | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219955@lists.php.net to get a copy of this message | ||
You know that anonymous function is just an instance of class
Closure so this would be
equivalent to check whether a variable is an anonymous function or not:
<?php
$test = function () {};
if (is_callable($test) && is_object($test) && $test instanceof Closure) { /* ... */
}
?>
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.175 (proxied: 140.213.170.126)
----
Manual Page -- https://php.net/manual/en/reflectionfunction.isanonymous.php
Edit -- https://main.php.net/note/edit/127999
Del: integrated -- https://main.php.net/note/delete/127999/integrated
Del: useless -- https://main.php.net/note/delete/127999/useless
Del: bad code -- https://main.php.net/note/delete/127999/bad+code
Del: spam -- https://main.php.net/note/delete/127999/spam
Del: non-english -- https://main.php.net/note/delete/127999/non-english
Del: in docs -- https://main.php.net/note/delete/127999/in+docs
Del: other reasons-- https://main.php.net/note/delete/127999
Reject -- https://main.php.net/note/reject/127999
Search -- https://main.php.net/manage/user-notes.php