3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?PHP class COMMENT { function A() { COMMENT::B(); } function B() { echo preg_replace_callback('~a~', array('self', 'C'), 'a'); } function C() { return 'c'; } } class X { function A() { $x = new COMMENT(); $x->a(); } } error_reporting(E_ALL); //ini_set('display_errors', 'on'); X::A();
Output for 7.0.0 - 7.1.0
Deprecated: Non-static method X::A() should not be called statically in /in/8uX2U on line 31 c
Output for 5.0.0 - 5.3.29, hhvm-3.10.0 - 3.13.2
c
Output for 5.4.0 - 5.6.28
Strict Standards: Non-static method X::A() should not be called statically in /in/8uX2U on line 31 c
Output for 4.3.0 - 4.4.9
Warning: preg_replace_callback() requires argument 2, 'self::C', to be a valid callback in /in/8uX2U on line 11 a