Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
bug #1276 FileByteStream compatibility with PHP 7.4 (Daniel Schischkin)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 6.3-dev branch.

Discussion
----------

FileByteStream compatibility with PHP 7.4

| Q                  | A
| ------------- | ---
| Bug fix?         | yes
| New feature?  | no
| Doc update?   | no
| BC breaks?    | no
| Deprecations? | yes
| Fixed tickets | #
| License       | MIT

Since the deprecation of returning an empty string in the `fread` function when an error occurs, checking for `false` is required for compatibility with PHP7.4.

See: https://www.php.net/manual/en/migration74.incompatible.php#migration74.incompatible.core.fread-fwrite

Commits
-------

64a7773 FileByteStream compatibility with PHP 7.4
  • Loading branch information
fabpot committed Aug 10, 2020
2 parents cdfcbf4 + 64a7773 commit 82398eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/classes/Swift/ByteStream/FileByteStream.php
Expand Up @@ -81,7 +81,7 @@ public function read($length)

// If we read one byte after reaching the end of the file
// feof() will return false and an empty string is returned
if ('' === $bytes && feof($fp)) {
if ((false === $bytes || '' === $bytes) && feof($fp)) {
$this->resetReadHandle();

return false;
Expand Down

0 comments on commit 82398eb

Please sign in to comment.