Tinkerwell - The PHP Scratchpad

Guzzle 7 Released

Published on by

Guzzle 7 Released image

The popular Guzzle HTTP client reached version 7 last week, with the exciting news that most users (the changelog says 95% of users) will be able to upgrade without modification. This release focused on increasing the minimum supported PHP version and introducing new language features found in PHP 7.

The main features of the 7.0 release include:

  • Implement PSR-18
  • Dropped PHP 5 support—the minimum PHP version is now 7.2
  • Type hints and return types for functions and methods have been added whenever possible
  • IDN support for redirects (see #2424 for details)

Be sure to check out the 6.0 to 7.0 upgrade guide for a list of known backward compatibility breaking changes with 6.x.

One update I found of note was client HTTP methods (i.e., get, post, etc.) with strong typing:

The get, head, put, post, patch, delete, getAsync, headAsync, putAsync, postAsync, patchAsync, and deleteAsync methods are now implemented as genuine methods on GuzzleHttp\Client, with strong typing. The original __call implementation remains unchanged for now, for maximum backward compatibility, but won’t be invoked under normal operation.

If you still need to access the v6 documentation and otherwise may need to use both Guzzle 6 and 7, check out the version guidance table in the project’s readme. At the time of writing, the latest docs have “Guzzle 6” in the heading, but docs.guzzlephp.org/en/latest/ are the Latest Guzzle 7 docs.

Release Notes

If you’re interested in the source code changes leading to v7.0.0, you can compare Guzzle 6.5 to 7.0. Below are the release notes from the project’s changelog:

7.0.1 – 2020-06-27

  • Fix multiply defined functions fatal error #2699

7.0.0 – 2020-06-27

No changes since 7.0.0-rc1.

7.0.0-rc1 – 2020-06-15

Changed

  • Use error level for logging errors in Middleware #2629
  • Disabled IDN support by default and require ext-intl to use it #2675

7.0.0-beta2 – 2020-05-25

Added

  • Using Utils class instead of functions in the GuzzleHttp namespace. #2546
  • ClientInterface::MAJOR_VERSION #2583

Changed

  • Avoid the getenv function when unsafe #2531
  • Added real client methods #2529
  • Avoid functions due to global install conflicts #2546
  • Use Symfony intl-idn polyfill #2550
  • Adding methods for HTTP verbs like Client::get(), Client::head(), Client::patch() etc #2529
  • ConnectException extends TransferException #2541
  • Updated the default User Agent to “GuzzleHttp/7” #2654

Fixed

  • Various intl icu issues #2626

Removed

  • Pool option pool_size #2528

7.0.0-beta1 – 2019-12-30

Added

Changed

  • Dont allow passing null as third argument to BadResponseException::__construct() #2427
  • Use SAPI constant instead of method call #2450
  • Use native function invocation #2444
  • Better defaults for PHP installations with old ICU lib 2454
  • Added visibility to all constants #2462
  • Dont allow passing null as URI to Client::request() and Client::requestAsync() #2461
  • Widen the exception argument to throwable #2495

Fixed

  • Logging when Promise rejected with a string #2311

Removed

  • Class SeekException #2162
  • RequestException::getResponseBodySummary() #2425
  • CookieJar::getCookieValue() #2433
  • uri_template() and UriTemplate #2440
  • Request options save_to and exceptions #2464
Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Filed in:
Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Visit Laravel Cloud
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $3200/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Cut PHP Code Review Time & Bugs into Half with CodeRabbit logo

Cut PHP Code Review Time & Bugs into Half with CodeRabbit

CodeRabbit is an AI-powered code review tool that specializes in PHP and Laravel, running PHPStan and offering automated PR analysis, security checks, and custom review features while remaining free for open-source projects.

Cut PHP Code Review Time & Bugs into Half with CodeRabbit
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit

The latest

View all →
Ben Bjurstrom: Laravel is the best Vibecoding stack for 2026 image

Ben Bjurstrom: Laravel is the best Vibecoding stack for 2026

Read article
Laravel Altitude - Opinionated Claude Code agents and commands for TALL stack development image

Laravel Altitude - Opinionated Claude Code agents and commands for TALL stack development

Read article
JSON:API Resource in Laravel 12.45 image

JSON:API Resource in Laravel 12.45

Read article
Caching With MongoDB for Faster Laravel Apps image

Caching With MongoDB for Faster Laravel Apps

Read article
Laravel 12.44 Adds HTTP Client afterResponse() Callbacks image

Laravel 12.44 Adds HTTP Client afterResponse() Callbacks

Read article
Handle Nested Data Structures in PHP with the Data Block Package image

Handle Nested Data Structures in PHP with the Data Block Package

Read article