|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2012-08-22 13:49 UTC] mail at hanicka dot net
 Description:
------------
base64_decode fails with only one char encoded in base64,
this bug only occurs on Mac OS X (10.7 and 10.8, only versions I currently have 
available)
bug is in PHP in Mac OS X and in actual version from php.net (5.4.6)
I tryied compile with gcc & clang.
Test script:
---------------
<?php 
echo base64_decode(base64_encode("A"))."\n";
?>
Expected result:
----------------
<?php echo base64_decode(base64_encode("A"))."\n"; ?>
must returns "A"
<?php echo base64_decode(base64_encode("C"))."\n"; ?>
must returns "C"
Actual result:
--------------
<?php echo base64_decode(base64_encode("A"))."\n"; ?>
returns "AD"
<?php echo base64_decode(base64_encode("C"))."\n"; ?>
returns "CD"
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 00:00:01 2025 UTC | 
what is base64_encode("A") outputs?base64_encode("A") returns "QQ=="That looks correct. So you are saying that base64_decode("QQ==") returns "AD" ? I really don't see how that is possible.