3v4l.org

run code in 300+ PHP versions simultaneously
<?php class class_a { public function __construct( public readonly string $foo, ) {} } class class_b extends class_a { public function __construct( string $foo, public readonly string $bar, ) { parent::__construct($foo); // no really needed here. } } class class_c { public function __construct( public readonly string $foo, public readonly string $bar, ) { } } $b = new class_b('foo', 'bar'); $c = new class_c('foo', 'bar'); var_dump(serialize($b), serialize($c));
Output for git.master, git.master_jit
string(58) "O:7:"class_b":2:{s:3:"foo";s:3:"foo";s:3:"bar";s:3:"bar";}" string(58) "O:7:"class_c":2:{s:3:"foo";s:3:"foo";s:3:"bar";s:3:"bar";}"

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:
57.27 ms | 944 KiB | 4 Q