3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FooArrayToString { public array $foo; public function doFoo(int $arr): void { $this->foo = $arr; var_dump($this->foo); } } var_dump((array)1); $f = new FooArrayToString(); $f->doFoo(1);
Output for git.master_jit, git.master
array(1) { [0]=> int(1) } Fatal error: Uncaught TypeError: Cannot assign int to property FooArrayToString::$foo of type array in /in/H5XnR:9 Stack trace: #0 /in/H5XnR(17): FooArrayToString->doFoo(1) #1 {main} thrown in /in/H5XnR on line 9
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:
31.12 ms | 405 KiB | 5 Q