Guest User

Untitled

a guest
Dec 12th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <?php
  2.  
  3. class a
  4. {
  5. public function getVal()
  6. {
  7. return 1;
  8. }
  9.  
  10. public static function construct($n)
  11. {
  12. $a = 'a';
  13.  
  14. do {
  15. $o = new $a();
  16. $b = get_class($o);
  17. $a = $b; $a++;
  18.  
  19. eval("class $a extends $b
  20. {
  21. public function getVal()
  22. {
  23. return parent::getVal() + 1;
  24. }
  25. }
  26. ");
  27. } while ($n !== $o->getVal());
  28.  
  29. return $o;
  30. }
  31. }
  32.  
  33. echo a::construct(38)->getVal();
Add Comment
Please, Sign In to add comment