$name === 'Jos', static fn(string $name): string => 'Bonjour ' . $name . '!', static fn(string $name): string => 'Hello ' . $name . '!' ); static::assertSame('Bonjour Jos!', $greet('Jos')); } public function testItRunsRightfunction(): void { $greet = Fun\when( static fn(string $name): bool => $name === 'Jos', static fn(string $name): string => 'Bonjour ' . $name . '!', static fn(string $name): string => 'Hello ' . $name . '!' ); static::assertSame('Hello World!', $greet('World')); } }