3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static $class_prop = 'class_property'; public $object_prop = 'object_property'; static function printClassProp() { //print 'prefix_' . self::$static_prop . '_postfix' . PHP_EOL; print "prefix_{self::$class_prop}_postfix" . PHP_EOL; print "prefix_{\\self::$class_prop}_postfix" . PHP_EOL; // <-- issue here } function printObjectProp() { print "prefix_{$this->object_prop}_postfix" . PHP_EOL; } } $foo = new Foo; $foo->printObjectProp(); Foo::printClassProp();
Output for git.master, git.master_jit, rfc.property-hooks
prefix_object_property_postfix Warning: Undefined variable $class_prop in /in/kXlEb on line 10 prefix_{self::}_postfix Warning: Undefined variable $class_prop in /in/kXlEb on line 11 prefix_{\self::}_postfix

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.7 ms | 401 KiB | 8 Q