|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39412 base64_decode does not return FALSE on failure
Submitted: 2006-11-07 10:01 UTC Modified: 2006-11-07 14:45 UTC
From: phpbugs at staznosti dot sk Assigned:
Status: Closed Package: *URL Functions
PHP Version: 4.4.4 OS: Linux
Private report: No CVE-ID: None
 [2006-11-07 10:01 UTC] phpbugs at staznosti dot sk
base64_decode does not return FALSE on failure, return garbled (binary) text instead

Reproduce code:
$string="This is short string!";


if ($test===FALSE) echo 'text is not base64 encoded';
else echo $test;

Expected result:
FALSE should be returned

Actual result:
garbled text / binary string


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-07 14:20 UTC]
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at

Will not get fixed in 4.4, but already fixed in 5.2.

php -r 'var_dump(base64_decode("This is short string!", 
 [2006-11-07 14:45 UTC] phpbugs at staznosti dot sk
I think this should get fixed in 4.x branch, too, as many people don't want (you can guess why - incompatiblity 4.x/5.x is the thing) or are not able to switch.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed May 31 17:03:38 2023 UTC