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.
It got into PHP 7.3 as well: https://www.php.net/ChangeLog-7.php#7.3.24
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.