3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo implements JsonSerializable { public function jsonSerialize() { return json_encode([1], JSON_PRETTY_PRINT); } } echo json_encode([new Foo]), "\n";

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
["[\n 1\n ]"]
Output for Arrow functions
["[\n 1\n]"]
Output for Object typehint
["[\n 1\n]"]
Output for Array change keys
["[\n 1\n ]"]
Output for Lexical anon
["[\n 1\n ]"]

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