php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36591 decode problem in base64_decode()
Submitted: 2006-03-02 15:30 UTC Modified: 2006-03-02 15:46 UTC
From: hariprakash at cynaptix dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.4.2 OS: Windows 2000
Private report: No CVE-ID: None
 [2006-03-02 15:30 UTC] hariprakash at cynaptix dot com
Description:
------------
base64_decode() gives a same output of '4' for two inputs 'NA==' and 'NO'. But base64_encode() gives output of 'NA==' for input '4'. I am currently using PHP 4.2.3 .

Reproduce code:
---------------
// 4 as str.
echo "4-". base64_encode( '4');
// or as int.
echo "4-". base64_encode( 4);
echo "<br />NO-". base64_decode( 'NO') ."-";
echo "<br />". base64_decode( base64_encode( '4'));


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-02 15:46 UTC] derick@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 27 21:00:03 2025 UTC