<?php
namespace Test;
class A
{
public function b(callable $b)
{
$b();
}
public function c(int $c)
{ }
public function d()
{
echo 'Hello, World' . PHP_EOL;
}
}
$foo = new Foo();
echo is_callable(array($foo, 'd')) . PHP_EOL;
$foo->b(array($foo, 'd'));
$foo->c(1);
$foo->c('a');
Fatal error: Uncaught Error: Class "Test\Foo" not found in /in/LpIZK:21
Stack trace:
#0 {main}
thrown in /in/LpIZK on line 21
Process exited with code 255.
Fatal error: Uncaught Error: Class 'Test\Foo' not found in /in/LpIZK:21
Stack trace:
#0 {main}
thrown in /in/LpIZK on line 21
Process exited with code 255.