3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TopLevel { public $arg; public function __construct(string $arg) { printf("Top level: %s\n", $arg); $this->arg = $arg; } } class MidLevel extends TopLevel { public function __construct(string $arg) { printf("Mid level: %s\n", $arg); parent::__construct($arg); } } class EndLevel extends MidLevel { public function __construct(string $arg) { printf("End level: %s\n", $arg); TopLevel::__construct($arg); } } $mid = new MidLevel('mid'); var_dump($mid->arg); echo "---\n"; $end = new EndLevel('end'); var_dump($end->arg);
Output for git.master, git.master_jit, rfc.property-hooks
Mid level: mid Top level: mid string(3) "mid" --- End level: end Top level: end string(3) "end"

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:
91.51 ms | 405 KiB | 5 Q