3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { public static $static_prop = 'class prop'; public $prop = 'object prop'; static function printClassProp() { print 'print_' . self::$static_prop; print "print_{self::$static_prop}"; } function printObjectProp() { print "print_{$this->prop}"; } } $foo = new Foo; $foo->printObjectProp(); Foo::printClassProp();
Output for 5.2.14 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
print_object propprint_class prop Notice: Undefined variable: static_prop in /in/V08OC on line 8 print_{self::}