Guest User

Untitled

a guest
May 23rd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. <?php
  2. class Fixnum extends Object {
  3. private $value;
  4. function __construct($value){
  5. $this->value = $value;
  6. }
  7. function ==($test){
  8. if($this->value == $test)
  9. return true;
  10. else
  11. return false;
  12. }
  13.  
  14. }
  15.  
  16. $a = new Fixnum(5);
  17. $a->==(5); #=> true
  18. $a->==(6); #=> false
  19.  
  20. ?>
Add Comment
Please, Sign In to add comment