3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait SampleTrait { /** * @var string */ private static $sample; final public static function setSample($sample) { self::$sample = $sample; } final public static function getSample() { return self::$sample; } } SampleTrait::setSample('test'); class SampleClass { use SampleTrait; } $sample = new SampleClass(); var_dump($sample::getSample());
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Calling static trait method SampleTrait::setSample is deprecated, it should only be called on a class using the trait in /in/GoUUr on line 21 Deprecated: Accessing static trait property SampleTrait::$sample is deprecated, it should only be accessed on a class using the trait in /in/GoUUr on line 12 NULL

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.4 ms | 401 KiB | 8 Q