3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait HasStaticPaths { public static $paths = []; } class FirstStaticPaths { use HasStaticPaths; } class SecondStaticPaths { use HasStaticPaths; } abstract class HasPaths { public static $paths = []; } class ThirdStaticPaths extends HasPaths {} class FourthStaticPaths extends HasPaths {} FirstStaticPaths::$paths[] = '/var'; SecondStaticPaths::$paths[] = '/usr'; ThirdStaticPaths::$paths[] = '/var'; FourthStaticPaths::$paths[] = '/usr'; var_dump(FirstStaticPaths::$paths); var_dump(SecondStaticPaths::$paths); var_dump(ThirdStaticPaths::$paths); var_dump(FourthStaticPaths::$paths);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { [0]=> string(4) "/var" } array(1) { [0]=> string(4) "/usr" } array(2) { [0]=> string(4) "/var" [1]=> string(4) "/usr" } array(2) { [0]=> string(4) "/var" [1]=> string(4) "/usr" }

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:
119.48 ms | 406 KiB | 5 Q