3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class Thing{ public function doSomething() : void{} } class ParentC{ /** @var Thing|null */ protected $thing; protected function __construct(){ $this->thing = null; } } class HelloWorld extends ParentC { public function __construct(Thing $thing){ $this->thing = $thing; parent::__construct(); $this->thing->doSomething(); //bang } } new HelloWorld(new Thing);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to a member function doSomething() on null in /in/ZVjQ5:21 Stack trace: #0 /in/ZVjQ5(25): HelloWorld->__construct(Object(Thing)) #1 {main} thrown in /in/ZVjQ5 on line 21
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:
25.68 ms | 402 KiB | 8 Q