3v4l.org

run code in 300+ PHP versions simultaneously
<?php class class_a { public function __construct( private 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( private readonly string $foo, public readonly string $bar, ) { } } $b = new class_b('foo_value', 'bar_value'); $c = new class_c('foo_value', 'bar_value'); var_dump(serialize($b), serialize($c));
Output for git.master, git.master_jit
string(80) "O:7:"class_b":2:{s:12:"class_afoo";s:9:"foo_value";s:3:"bar";s:9:"bar_value";}" string(80) "O:7:"class_c":2:{s:12:"class_cfoo";s:9:"foo_value";s:3:"bar";s:9:"bar_value";}"

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.53 ms | 939 KiB | 4 Q