Created
October 5, 2019 10:34
-
-
Save cspray/8d6cbd54f9cdab72847450d9c1995304 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 | |
require_once __DIR__ . '/vendor/autoload.php'; | |
use YourNamespace\Enums\Compass; | |
$north = Compass::North(); | |
$south = Compass::South(); | |
$east = Compass::East(); | |
$west = Compass::West(); | |
$values = Compass::values(); // [$north, $south, $east, $west] | |
$n = Compass::valueOf('North'); | |
$north->equals(Compass::North()); // true | |
$north->equals($n); // true | |
$north->equals($south); // false | |
$north->equals('North'); // false | |
$north->toString(); // 'North' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment