__invoke($y); } function f2(A $x, $y) { $x($y); $x->__invoke($y); } function f3(IfaceInvoke $x, $y) { $x($y); $x->__invoke($y); } $t1 = new Test1; $t2 = new Test2; f1($t1, 1); f1($t2, 2); f2($t1, 1); f3($t2, 2);