3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar{ public $state = "valid"; function baz($inject){ $this->state = "invalid"; $inject->qux(); $this->state = "valid"; } } $x = new Bar(); $x->baz(new class($x){ function __construct($x){ $this->x = $x; } function qux(){ echo $this->x->state . " pwned!"; } });
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property class@anonymous::$x is deprecated in /in/LU8U7 on line 19 invalid pwned!

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:
103.88 ms | 1613 KiB | 4 Q