3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { protected static $_instance; protected function __construct() {} public static function getInstance() { if (self::$_instance === null) { self::$_instance = new static(); } return self::$_instance; } } class B extends A { public function hi() { echo 'HI'; } } echo get_class(B::getInstance()); B::hi();
based on F4Dt6
Output for 7.0.0 - 7.2.0
B Deprecated: Non-static method B::hi() should not be called statically in /in/5UQE7 on line 26 HI
Output for 5.3.18 - 5.6.28
B Strict Standards: Non-static method B::hi() should not be called statically in /in/5UQE7 on line 26 HI