(PHP 5 >= 5.3.0, PHP 7, PHP 8)
ReflectionFunctionAbstract::isClosure — Checks if closure
Checks whether the reflected function is a Closure.
This function has no parameters.
Example #1 ReflectionFunctionAbstract::isClosure() example
<?php
/ Non-closure
$function1 = 'str_replace';
$reflection1 = new ReflectionFunction($function1);
var_dump($reflection1->isClosure());
/ Closure
$function2 = function () {};
$reflection2 = new ReflectionFunction($function2);
var_dump($reflection2->isClosure());
?>
The above example will output:
bool(false) bool(true)
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant