3v4l.org

run code in 300+ PHP versions simultaneously
<?php class B { } class A { public function M() { echo("this=" . get_class($this) . "\n"); $x = "this"; $$x = new B(); echo("this=" . get_class($this) . "\n"); } } $a = new A(); $a->M(); echo get_class($a);
Output for git.master, git.master_jit, rfc.property-hooks
this=A Fatal error: Uncaught Error: Cannot re-assign $this in /in/MeVBD:12 Stack trace: #0 /in/MeVBD(19): A->M() #1 {main} thrown in /in/MeVBD on line 12
Process exited with code 255.

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