3v4l.org

run code in 500+ PHP versions simultaneously
<?php class T1 {} class T2 extends T1 {} class A { /*readonly*/ public T1 $a; public function foo(T1 $a) { $this->a = $a; } } class B extends A { /*readonly*/ public T2 $a; } $foo = new B(); $foo->foo(new T1());
Output for git.master_jit, git.master
Fatal error: Type of B::$a must be T1 (as in class A) in /in/DQ3To on line 14 Stack trace: #0 {main}
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:
42.71 ms | 711 KiB | 3 Q