<?php
class A {
public function sayHello(){ echo "Hello"; }
}
$res = ["A", "sayHello"];
function INeedYou(callcable $callable) {
echo $callable();
}
INeedYou($res);
Fatal error: Uncaught TypeError: INeedYou(): Argument #1 ($callable) must be of type callcable, array given, called in /in/gA1ak on line 13 and defined in /in/gA1ak:9
Stack trace:
#0 /in/gA1ak(13): INeedYou(Array)
#1 {main}
thrown in /in/gA1ak on line 9
Process exited with code 255.
Fatal error: Uncaught TypeError: Argument 1 passed to INeedYou() must be an instance of callcable, array given, called in /in/gA1ak on line 13 and defined in /in/gA1ak:9
Stack trace:
#0 /in/gA1ak(13): INeedYou(Array)
#1 {main}
thrown in /in/gA1ak on line 9
Process exited with code 255.
Catchable fatal error: Argument 1 passed to INeedYou() must be an instance of callcable, array given, called in /in/gA1ak on line 13 and defined in /in/gA1ak on line 9
Process exited with code 255.