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::$class_prop . '_postfix' . PHP_EOL; print "prefix_{\\self::$class_prop}_postfix" . PHP_EOL; } 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 prefix_Class_Property_postfix Warning: Undefined variable $class_prop in /in/kmats 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:
43.78 ms | 401 KiB | 8 Q