3v4l.org

run code in 300+ PHP versions simultaneously
<?php class G { private $s; function ​() { if (!$this->s) { $this->s = 'g'; } if ($a = @func_get_arg(0)) { return$this->s .= $a; } $this->s .= 'o'; return $this; } } function g() { return new G(); } // This is the best that you can do in PHP // because of this: https://wiki.php.net/rfc/uniform_variable_syntax // // PHP supports unicode, unicode supports zero-width spaces echo g()->​()->​()->​()->​('al') . PHP_EOL; echo g()->​()->​('al') . PHP_EOL; echo g​('al') . PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function in /in/Ilclb:12 Stack trace: #0 /in/Ilclb(12): func_get_arg(0) #1 /in/Ilclb(31): G->​() #2 {main} thrown in /in/Ilclb 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:
39.22 ms | 401 KiB | 8 Q