Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Curl/Fsockopen: add some extra defensive coding
The `error_get_last()` function can return `null` if no error occurred, in which case, the `throw new Exception()` statement will run into two new errors: * `Trying to access array offset on value of type null` for accessing `$error['message']`. * ... which then leads to a `Exception::__construct(): Passing null to parameter #1 ($message) of type string is deprecated`. This commit adds some defensive coding to handle the hypothetical situation that `error_get_last()` would return `null` when a file could not be opened. Note: this is actually a bug in PHPUnit 10 which breaks `error_get_last()`. We should be able to remove the extra defensive coding once the upstream bug has been fixed. Upstream bug report: sebastianbergmann/phpunit#5428
- Loading branch information