Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class a
- {
- public function getVal()
- {
- return 1;
- }
- public static function construct($n)
- {
- $a = 'a';
- do {
- $o = new $a();
- $b = get_class($o);
- $a = $b; $a++;
- eval("class $a extends $b
- {
- public function getVal()
- {
- return parent::getVal() + 1;
- }
- }
- ");
- } while ($n !== $o->getVal());
- return $o;
- }
- }
- echo a::construct(38)->getVal();
Add Comment
Please, Sign In to add comment