3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types = 1); class x { function __toString() : string { return "abc"; } } $x = new x; print $x . " and $x\n"; print $x; echo $x; echo PHP_EOL; print implode(', ', [$x, $x]); print implode($x, [1, 2]); ?>
Output for git.master, git.master_jit, rfc.property-hooks
abc and abc abcabc abc, abc Fatal error: Uncaught TypeError: implode(): Argument #1 ($separator) must be of type array|string, x given in /in/R6XVR:17 Stack trace: #0 /in/R6XVR(17): implode(Object(x), Array) #1 {main} thrown in /in/R6XVR on line 17
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:
43.18 ms | 1023 KiB | 4 Q