3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { const CONSTANT = 'constant value'; function showConstant() { echo self::CONSTANT . "\n"; } } echo MyClass::CONSTANT . "\n"; $classname = "MyClass"; echo $classname::CONSTANT . "\n"; // As of PHP 5.3.0 class B { function __construct() { $this->myclass = new MyClass(); $this->myclass->showConstant(); echo $this->myclass::CONSTANT; // <--------- from PHP 7 on } } $b = new B ?>
Output for git.master, git.master_jit, rfc.property-hooks
constant value constant value Deprecated: Creation of dynamic property B::$myclass is deprecated in /in/FPBIL on line 20 constant value constant value

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:
50.75 ms | 401 KiB | 8 Q