Last active
January 18, 2021 14:30
-
-
Save timkelty/c96c80104197f5bab929821e1400f45c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Type juggle keys as string or array | |
// ------------------------------------- | |
public function getFoo(mixed $keyOrKeys) | |
{ | |
} | |
// Variable args | |
// ------------------------------------- | |
public function getFoo(string ...$keys) | |
{ | |
} | |
// Explicit typed methods | |
// ------------------------------------- | |
public function getFoo(string $key) | |
{ | |
} | |
public function getManyFoo(array $keys) | |
{ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment