3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Weird { public static function test() { var_dump(is_a(isset($this) ? $this : self, __CLASS__)); } } Weird::test(); $w = new Weird; $w->test();
based on lKIqO
Output for 7.2.0
Warning: Use of undefined constant self - assumed 'self' (this will throw an Error in a future version of PHP) in /in/9nrnO on line 5 bool(false) Warning: Use of undefined constant self - assumed 'self' (this will throw an Error in a future version of PHP) in /in/9nrnO on line 5 bool(false)
Output for 5.3.19 - 7.1.10
Notice: Use of undefined constant self - assumed 'self' in /in/9nrnO on line 5 bool(false) Notice: Use of undefined constant self - assumed 'self' in /in/9nrnO on line 5 bool(false)