Answers for "php invoke"

PHP
0

php invoke

<?php
class CallableClass
{
    public function __invoke($x)
    {
        var_dump($x);
    }
}
$obj = new CallableClass;
$obj(5);
var_dump(is_callable($obj));
?>
Posted by: Guest on December-11-2020

Browse Popular Code Answers by Language