Advertisement
Guest User

De Sinter class

a guest
Jul 13th, 2021
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. <?php
  2. class Sinter
  3. {
  4.     private $sint;
  5.     private $piet;
  6.     private $gezeik = 1412460826651842596;
  7.     private $gezeur = 302404053628330;
  8.     protected $args;
  9.  
  10.     function __construct($args = null)
  11.     {
  12.         $this->sint = get_class($this) . $args;
  13.         $this->piet = $this->ophef($this->gezeik, 9) . $this->ophef($this->gezeur, 7);
  14.     }
  15.  
  16.     function ophef($gezeik, $h)
  17.     {
  18.         $output = (string) NULL;
  19.         for ($a = 1; $a <= $h; $a++) {
  20.             $output .= chr(floor($gezeik / pow(120, ($h - $a))));
  21.             $gezeik = ($gezeik % pow(120, ($h - $a)));
  22.         }
  23.         return $output;
  24.     }
  25.  
  26.     function sint()
  27.     {
  28.         return $this->sint;
  29.     }
  30.  
  31.     function piet()
  32.     {
  33.         return $this->piet;
  34.     }
  35. }
  36.  
  37. class Piet extends Sinter
  38. {
  39.     function pieterbaas()
  40.     {
  41.         return $this->piet();
  42.     }
  43. }
  44.  
  45. $klaas = new Sinter("klaas");
  46. $piet = new Piet();
  47.  
  48. echo $klaas->sint() . $piet->pieterbaas();
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement