3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class Foo { public function __construct(int $integer) { $this->integer = $integer; } } try { $foo = new Foo('1'); } catch (TypeError $e) { } finally { assert(isset($e), 'TypeError was thrown'); assert(!isset($foo), '$foo is unset'); } $foo = (new ReflectionClass(Foo::class))->newInstance('1'); var_dump($foo);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property Foo::$integer is deprecated in /in/aZTJl on line 5 object(Foo)#3 (1) { ["integer"]=> int(1) }

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:
169.79 ms | 405 KiB | 5 Q