3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=0); class Item { // more code public function getPrice() { return $this->price; } public function setPrice(float $price) { $this->price = $price; } public function setTitle(string $title) { $this->title = $title; } public function setPublished(bool $published) { $this->published = $published; } public function setId(int $id) { $this->id = $id; } } $item = new Item(); $item->setPrice('1.2'); var_dump($item->getPrice());
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property Item::$price is deprecated in /in/VpAJF on line 12 float(1.2)

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:
58.07 ms | 401 KiB | 8 Q