3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { public $p='p'; function showMe() { var_dump($this); } } $t = Test; $t->showMe();
based on WMfNB
Output for 7.2.0
Warning: Use of undefined constant Test - assumed 'Test' (this will throw an Error in a future version of PHP) in /in/oOTRW on line 10 Fatal error: Uncaught Error: Call to a member function showMe() on string in /in/oOTRW:11 Stack trace: #0 {main} thrown in /in/oOTRW on line 11
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant Test - assumed 'Test' in /in/oOTRW on line 10 Fatal error: Uncaught Error: Call to a member function showMe() on string in /in/oOTRW:11 Stack trace: #0 {main} thrown in /in/oOTRW on line 11
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Notice: Use of undefined constant Test - assumed 'Test' in /in/oOTRW on line 10 Fatal error: Call to a member function showMe() on string in /in/oOTRW on line 11
Process exited with code 255.
Output for 5.3.18 - 5.5.35
Notice: Use of undefined constant Test - assumed 'Test' in /in/oOTRW on line 10 Fatal error: Call to a member function showMe() on a non-object in /in/oOTRW on line 11
Process exited with code 255.