3v4l.org

run code in 300+ PHP versions simultaneously
<?php class gardenObject implements JsonSerializable { public function jsonSerialize() { $data[] = $this->flowers; $data[] = $this->fruit; $data[] = $this->herbs; return $data; } } $garden = new gardenObject(); $garden->flowers = array("clematis", "geranium", "hydrangea"); $garden->herbs = array("mint", "sage", "chives", "rosemary"); $garden->fruit = array("apple", "rhubarb"); echo json_encode($garden);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Return type of gardenObject::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/ZUZn6 on line 4 Deprecated: Creation of dynamic property gardenObject::$flowers is deprecated in /in/ZUZn6 on line 12 Deprecated: Creation of dynamic property gardenObject::$herbs is deprecated in /in/ZUZn6 on line 13 Deprecated: Creation of dynamic property gardenObject::$fruit is deprecated in /in/ZUZn6 on line 14 [["clematis","geranium","hydrangea"],["apple","rhubarb"],["mint","sage","chives","rosemary"]]

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:
41.33 ms | 402 KiB | 8 Q