3v4l.org

run code in 300+ PHP versions simultaneously
<?php use GuzzleHttp\Client; use GuzzleHttp\Subscriber\Oauth\Oauth1; $client = new Client(); // Using "guzzlehttp/oauth-subscriber" Composer package. $oauth = new Oauth1([ 'consumer_key' => '', 'consumer_secret' => '', 'token' => '', 'token_secret' => '' ]); $client->getEmitter()->attach($oauth); $url = "https://example.com/services/oath2/token"; $response = $client->request( 'POST', $url, [ 'auth' => ['username', 'password'] ] ); echo $response->getBody();
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Fatal error: Uncaught Error: Class "GuzzleHttp\Client" not found in /in/3ZJmW:6 Stack trace: #0 {main} thrown in /in/3ZJmW on line 6
Process exited with code 255.
Output for 7.1.0 - 7.1.24, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught Error: Class 'GuzzleHttp\Client' not found in /in/3ZJmW:6 Stack trace: #0 {main} thrown in /in/3ZJmW on line 6
Process exited with code 255.
Output for 5.6.38
Fatal error: Class 'GuzzleHttp\Client' not found in /in/3ZJmW on line 6
Process exited with code 255.

preferences:
104.3 ms | 1482 KiB | 4 Q