3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Command { public function run(): int { return $this->execute(); } protected function execute(): int { throw new LogicException('You must override the execute() method in the concrete command class.'); } } class FooCommand extends Command { protected function execute(): int { echo "Executing FooCommand\n"; return 0; } } class BarCommand extends Command { public function __construct(private readonly FooCommand $command) { } protected function execute(): int { $this->command->execute(); echo "Executing BarCommand\n"; return 0; } } $command = new BarCommand(new FooCommand()); $command->run();
Output for git.master_jit, git.master, rfc.property-hooks
Executing FooCommand Executing BarCommand

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