3v4l.org

run code in 300+ PHP versions simultaneously
<?php final readonly class Client { public function __construct( private string $a, private string $very, private string $long, private string $list, private string $of, private string $constructor, private string $argument, private string $userAgent, ) { } public function fetch(int $id): array { var_dump("fetching user $id"); // Simulate fetching from remote service $this->userAgent; return [ 'id' => $id, 'name' => 'John Doe', ]; } public function getName(): string { return 'The Super API Client'; } } final readonly class UserRepository { public function __construct( public Client $client, ) { } public function find(int $id): array { return $this->client->fetch($id); } } $reflector = new ReflectionClass(Client::class); $client = $reflector->newLazyProxy(function ($x) { var_dump("init"); return new Client( 'a', 'very', 'long', 'list', 'of', 'constructor', 'argument', 'Mozilla/5.0', ); }); $repository = new UserRepository($client); var_dump($repository->client->getName()); var_dump($repository->find(42));

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.5.00.0110.01119.85
8.4.150.0010.00114.05
8.4.140.0130.00920.44
8.4.130.0110.00618.56
8.4.120.0130.00724.28
8.4.110.0120.00818.22
8.4.100.0120.00517.80
8.4.90.0110.00920.65
8.4.80.0130.00719.96
8.4.70.0030.00519.03
8.4.60.0120.00920.84
8.4.50.0110.00920.51
8.4.40.0130.00617.60
8.4.30.0070.01322.23
8.4.20.0040.00419.52
8.4.10.0080.00818.27
8.3.280.0110.00918.53
8.3.270.0090.01216.63
8.3.260.0130.00616.78
8.3.250.0080.01118.54
8.3.240.0130.00617.29
8.3.230.0110.00716.66
8.3.220.0100.00918.98
8.3.210.0110.00716.49
8.3.200.0020.00716.54
8.3.190.0120.00716.90
8.3.180.0080.00718.61
8.3.170.0070.01117.16
8.3.160.0090.01218.36
8.3.150.0120.00616.79
8.3.140.0150.00016.52
8.3.130.0070.01118.54
8.3.120.0090.00016.68
8.3.110.0080.00016.71
8.3.50.0060.00316.80
8.2.290.0090.00920.42
8.2.280.0120.00620.42
8.2.270.0060.01318.72
8.2.260.0090.00616.91
8.2.250.0090.00916.78
8.2.240.0090.00618.42
8.2.230.0080.00816.89
8.1.330.0120.00621.73
8.1.320.0100.00916.04
8.1.310.0070.01016.48
8.1.300.0040.00416.05

preferences:
33.69 ms | 403 KiB | 5 Q