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();

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.130.0100.01017.66
8.4.120.0120.00820.76
8.4.110.0100.00922.53
8.4.100.0140.00717.82
8.4.90.0130.00718.60
8.4.80.0070.00319.37
8.4.70.0110.00918.24
8.4.60.0130.00719.01
8.4.50.0110.00918.91
8.4.40.0060.01017.75
8.4.30.0040.00418.52
8.4.20.0150.00618.61
8.4.10.0050.00319.34
8.3.260.0090.01016.70
8.3.250.0090.00920.90
8.3.240.0100.00616.41
8.3.230.0130.00716.45
8.3.220.0100.00917.17
8.3.210.0030.00516.62
8.3.200.0060.00316.50
8.3.190.0030.00517.06
8.3.180.0050.00316.71
8.3.170.0060.01220.59
8.3.160.0030.00620.37
8.3.150.0070.01116.56
8.3.140.0130.00717.31
8.3.130.0040.00418.57
8.3.120.0040.00418.89
8.3.110.0000.01522.58
8.3.100.0000.00920.94
8.3.90.0080.00020.94
8.3.50.0050.00520.94
8.3.00.0190.00020.71
8.2.290.0060.00320.60
8.2.280.0100.00520.32
8.2.270.0120.00617.26
8.2.260.0120.00616.46
8.2.250.0040.00416.70
8.2.240.0120.00619.13
8.2.230.0030.00622.58
8.2.220.0000.00922.58
8.2.210.0060.00322.58
8.2.130.0100.01020.89
8.2.120.0090.00920.83
8.2.110.0070.01320.48
8.2.100.0150.00420.76
8.2.90.0130.00620.69
8.2.80.0090.00920.49
8.2.70.0190.00020.37
8.2.60.0130.00720.66
8.2.50.0110.00720.55
8.2.40.0090.00920.50
8.2.30.0030.01020.26
8.2.20.0060.01220.21
8.2.10.0030.00620.43
8.2.00.0150.00320.43
8.1.330.0080.01022.12
8.1.320.0130.00615.77
8.1.310.0080.00818.55
8.1.300.0090.00019.72
8.1.260.0110.00723.75
8.1.250.0070.01323.81
8.1.240.0130.00320.40
8.1.230.0090.00620.29
8.1.220.0000.01420.28
8.1.210.0030.00520.30
8.1.200.0030.00520.34
8.1.190.0050.00320.41
8.1.180.0030.00720.16
8.1.170.0040.00420.18
8.1.160.0080.00020.23
8.1.150.0050.00320.22
8.1.140.0080.00020.22
8.1.130.0080.00020.52
8.1.120.0080.00020.29
8.1.110.0050.00320.29
8.1.100.0030.00520.34
8.1.90.0040.00420.34
8.1.80.0000.00820.21
8.1.70.0040.00420.29
8.1.60.0080.00020.54
8.1.50.0050.00320.41
8.1.40.0080.00020.46
8.1.30.0080.00020.57
8.1.20.0030.00520.55
8.1.10.0060.00320.53
8.1.00.0040.00420.39

preferences:
53.93 ms | 403 KiB | 5 Q