3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A implements JsonSerializable { public function jsonSerialize() { return new A; } } echo "AAA\n"; var_dump( json_encode( new A ) ); echo "BBB\n";
Output for git.master, git.master_jit
Deprecated: Return type of A::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/AtfmY on line 4 AAA
Process exited with code 139.
Output for rfc.property-hooks
Deprecated: Return type of A::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/AtfmY on line 4 AAA Fatal error: Uncaught Error: Maximum call stack size of 8306688 bytes reached. Infinite recursion? in /in/AtfmY:5 Stack trace: #0 [internal function]: A->jsonSerialize() #1 /in/AtfmY(10): json_encode(Object(A)) #2 {main} thrown in /in/AtfmY on line 5
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:
57.72 ms | 401 KiB | 8 Q