3v4l.org

run code in 300+ PHP versions simultaneously
<?php use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; class Solution { public function __construct(private ClientInterface $client) { } public function getHost(): string { return $this->client->getConfig('base_uri'); } } $solution = new Solution(new Client(['base_uri' => 'https://internal-api.checkout51.com/'])); var_dump($solution->getHost());
Output for 8.1.0 - 8.1.29, 8.2.0 - 8.2.21, 8.3.0 - 8.3.9
Fatal error: Uncaught Error: Class "GuzzleHttp\Client" not found in /in/BgWJ8:17 Stack trace: #0 {main} thrown in /in/BgWJ8 on line 17
Process exited with code 255.

preferences:
86.86 ms | 403 KiB | 67 Q