SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. require_once __DIR__ . '/vendor/autoload.php';
  4.  
  5. use YourNamespace\Enums\Compass;
  6.  
  7. $north = Compass::North();
  8. $south = Compass::South();
  9. $east = Compass::East();
  10. $west = Compass::West();
  11.  
  12. $values = Compass::values(); // [$north, $south, $east, $west]
  13. $n = Compass::valueOf('North');
  14.  
  15. $north->equals(Compass::North());  // true
  16. $north->equals($n); // true
  17. $north->equals($south); // false
  18. $north->equals('North'); // false
  19.  
  20. $north->toString(); // 'North'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top