Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement