php-src/ext/standard/tests/url/base64_decode_basic_001.phpt
Steph Fox 87fac43ac0 - killed off UEXPECT
- html_translation_table and setlocale tests are no longer relevant
- there are a number of ANSI-encoded files. Is this deliberate?
2008-05-27 10:50:48 +00:00

25 lines
1.0 KiB
PHP

--TEST--
Test base64_decode() function : basic functionality - ensure all base64 alphabet is supported.
--FILE--
<?php
/* Prototype : proto string base64_decode(string str[, bool strict])
* Description: Decodes string using MIME base64 algorithm
* Source code: ext/standard/base64.c
* Alias to functions:
*/
echo "Decode an input string containing the whole base64 alphabet:\n";
$allbase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var_dump(bin2hex(base64_decode($allbase64)));
var_dump(bin2hex(base64_decode($allbase64, false)));
var_dump(bin2hex(base64_decode($allbase64, true)));
echo "Done";
?>
--EXPECT--
Decode an input string containing the whole base64 alphabet:
unicode(96) "00108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31cb3d35db7e39ebbf3dfbf"
unicode(96) "00108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31cb3d35db7e39ebbf3dfbf"
unicode(96) "00108310518720928b30d38f41149351559761969b71d79f8218a39259a7a29aabb2dbafc31cb3d35db7e39ebbf3dfbf"
Done