guzzle / psr7

PSR-7 HTTP message library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

parse_url accepts zero as a port as of PHP 7.4.12

jbboehr opened this issue · comments

PHP version: 7.4.12

Description:
The test suite fails with:

  1) GuzzleHttp\Tests\Psr7\UriTest::testParseUriPortCannotBeZero
  Failed asserting that exception of type "InvalidArgumentException" is thrown.

See: https://www.php.net/ChangeLog-7.php#7.4.12 and http://bugs.php.net/80114

Possible Solution
Remove the testParseUriPortCannotBeZero test case, or add two cases depending on the PHP version.

Additional context
I test my PHP extension (php-psr) against your unit tests to make sure I'm implementing the interfaces correctly. Well, they started failing on the latest PHP 7.4 :)

Except apparently it drops it from the return value. A shame it got into a release half-finished.

I was going to submit a PR fixing the test via version constraints, but the compatibility matrix on it is going to be insane so I would just remove it.