3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DEP1{} class DEP2{} class DEP3{} interface A{ function get1(): DEP1; function get2(): DEP2; function get3(): DEP3; } class AImpl implements A{ function __construct(A $DEP){ $this->x = $DEP->get1(); $this->y = $DEP->get2(); $this->z = $DEP->get3(); } function get1(): DEP1{ return $this->x; } function get2(): DEP2{ return $this->y; } function get3(): DEP3{ return $this->z; } } new AImpl(new class() implements A{ function get1(): DEP1{ return new DEP1; } function get2(): DEP2{ return new DEP2; } function get3(): DEP3{ return new DEP3; } });
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property AImpl::$x is deprecated in /in/XdBiJ on line 15 Deprecated: Creation of dynamic property AImpl::$y is deprecated in /in/XdBiJ on line 16 Deprecated: Creation of dynamic property AImpl::$z is deprecated in /in/XdBiJ on line 17

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:
53.38 ms | 402 KiB | 8 Q