Lines Matching refs:closures

9 $closures[0] = Closure::fromCallable('foo');
10 $closures[1] = Closure::fromCallable('foo');
12 printf("foo == foo: %s\n", $closures[0] == $closures[1] ? "OK" : "FAIL");
14 $closures[0] = Closure::fromCallable('strlen');
15 $closures[1] = Closure::fromCallable('strlen');
17 printf("strlen == strlen: %s\n", $closures[0] == $closures[1] ? "OK" : "FAIL");
19 $closures[0] = Closure::fromCallable('strlen');
20 $closures[1] = Closure::fromCallable('strrev');
22 printf("strlen != strrev: %s\n", $closures[0] != $closures[1] ? "OK" : "FAIL");
48 $closures[0] = Closure::fromCallable([Foo::class, "existsStatic"]);
49 $closures[1] = Closure::fromCallable([Bar::class, "existsStatic"]);
51 printf("foo::existsStatic != bar::existsStatic: %s\n", $closures[0] != $closures[1] ? "OK" : "FAIL"…
55 $closures[0] = Closure::fromCallable([$foo, "exists"]);
56 $closures[1] = $closures[0]->bindTo(new Foo);
58 printf("foo#0::exists != foo#1::exists: %s\n", $closures[0] != $closures[1] ? "OK" : "FAIL");
62 $closures[0] = Closure::fromCallable([$foo, "traitMethod"]);
63 $closures[1] = Closure::fromCallable([$baz, "traitMethod"]);
65 printf("foo::traitMethod != baz::traitMethod: %s\n", $closures[0] != $closures[1] ? "OK" : "FAIL");
67 $closures[0] = Closure::fromCallable([$foo, "traitMethod"]);
68 $closures[1] = Closure::fromCallable([$foo, "aliasMethod"]);
70 printf("foo::traitMethod != foo::aliasMethod: %s\n", $closures[0] != $closures[1] ? "OK" : "FAIL");
72 $closures[0] = Closure::fromCallable([$foo, "exists"]);
73 $closures[1] = Closure::fromCallable([$foo, "exists"]);
75 printf("foo::exists == foo::exists: %s\n", $closures[0] == $closures[1] ? "OK" : "FAIL");
77 $closures[0] = Closure::fromCallable([$foo, "method"]);
78 $closures[1] = Closure::fromCallable([$foo, "method"]);
80 printf("foo::method == foo::method: %s\n", $closures[0] == $closures[1] ? "OK" : "FAIL");
82 $closures[1] = $closures[1]->bindTo(new Bar);
84 printf("foo::method != bar::method: %s\n", $closures[0] != $closures[1] ? "OK" : "FAIL");
86 $closures[0] = Closure::fromCallable([$foo, "method"]);
87 $closures[1] = Closure::fromCallable([$foo, "method2"]);
89 printf("foo::method != foo::method2: %s\n", $closures[0] != $closures[1] ? "OK" : "FAIL");
91 $closures[2] = Closure::fromCallable([$closures[0], "__invoke"]);
92 $closures[3] = Closure::fromCallable([$closures[1], "__invoke"]);
94 printf("Closure[0]::invoke != Closure[1]::invoke: %s\n", $closures[2] != $closures[3] ? "OK" : "FAI…
96 $closures[2] = Closure::fromCallable([$closures[0], "__invoke"]);
97 $closures[3] = Closure::fromCallable([$closures[0], "__invoke"]);
99 printf("Closure[0]::invoke == Closure[0]::invoke: %s\n", $closures[2] == $closures[3] ? "OK" : "FAI…