3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class myclass { public $x; function mymethod() { echo $this->x; } } $a = new myclass(); $a->x=10; $b->x=20; $c= clone $b; $c->x=30; $a->mymethod(); $b->mymethod(); $c->mymethod(); ?>
based on DMmIb
Output for 7.0.0 - 7.3.0rc3
Warning: Creating default object from empty value in /in/ELoDD on line 12 10 Fatal error: Uncaught Error: Call to undefined method stdClass::mymethod() in /in/ELoDD:17 Stack trace: #0 {main} thrown in /in/ELoDD on line 17
Process exited with code 255.
Output for hhvm-3.15.4
Warning: Creating default object from empty value in /in/ELoDD on line 12 10 Fatal error: Uncaught Error: Call to undefined method stdClass::mymethod() in /in/ELoDD:17 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Warning: Creating default object from empty value in /in/ELoDD on line 12 10 Fatal error: Call to undefined method stdClass::mymethod() in /in/ELoDD on line 17
Process exited with code 255.