3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __construct( public int $a = 1 ) {} } class B extends A { public function __construct( public string $b = 'hello' ) {} } $b = new B(); $b=1; var_dump($b->a, $b->b);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Attempt to read property "a" on int in /in/qKUlV on line 17 Warning: Attempt to read property "b" on int in /in/qKUlV on line 17 NULL NULL

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:
30.2 ms | 409 KiB | 6 Q