3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); class Foo { private array $data = []; public function __set(string $name, $value): void { $this->data[$name] = $value; } public function __isset(string $name): bool { return isset($this->data[$name]); } public function __unset(string $name): void { unset($this->data[$name]); } } $foo = new Foo(); $foo->1 = 'one'; $foo->2 = 'two'; var_dump( isset($foo->1), // true isset($foo->2) // true ); unset($foo->1); var_dump( isset($foo->1) // false );
Output for git.master_jit, git.master
Parse error: syntax error, unexpected integer "1", expecting identifier or variable or "{" or "$" in /in/pPJDt on line 25
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:
56.69 ms | 707 KiB | 3 Q