<?php function test(Closure $callback): void { $toto = call_user_func($callback); } $fake = new class { public $called = false; public function __invoke() { $this->called = true; } }; var_dump($fake); test(Closure::fromCallable($fake)); var_dump($fake);
You have javascript disabled. You will not be able to edit any code.