3v4l.org

run code in 500+ PHP versions simultaneously
<?php class x { private $p = 5; function foo() { $b = 2; $f = fn($a) => $a + $b + $this->p; echo $f(1); // 8 = 1 + 2 + 5 $t = $this; $f = static fn($a) => $a + $b + $t->p; echo $f(1); // 8 = 1 + 2 + 5 $f = static fn($a) => $a + $b + $this->p; // Only an error if the code is executed //echo $f(1); } } new x()->foo();
Output for rfc.property-hooks
Parse error: syntax error, unexpected token "->" in /in/aXec4 on line 21
Process exited with code 255.
Output for git.master, git.master_jit
88

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.98 ms | 2716 KiB | 3 Q