????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.191 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/b8009/php-5.6.22/ext/standard/tests/url/ |
Upload File : |
--TEST--
Test base64_encode() function : basic functionality - check algorithm round trips
--FILE--
<?php
/* Prototype : proto string base64_encode(string str)
* Description: Encodes string using MIME base64 algorithm
* Source code: ext/standard/base64.c
* Alias to functions:
*/
/*
* Test base64_encode with single byte values.
*/
echo "*** Testing base64_encode() : basic functionality ***\n";
$values = array(
"Hello World",
"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!%^&*(){}[]",
"\n\t Line with control characters\r\n",
"\xC1\xC2\xC3\xC4\xC5\xC6",
"\75\76\77\78\79\80"
);
echo "\n--- Testing base64_encode() with binary string input ---\n";
$counter = 1;
foreach($values as $str) {
echo "-- Iteration $counter --\n";
$enc = base64_encode($str);
$dec = base64_decode($enc);
if ($dec != $str) {
echo "TEST FAILED\n";
} else {
echo "TEST PASSED\n";
}
$counter ++;
}
?>
===Done===
--EXPECTF--
*** Testing base64_encode() : basic functionality ***
--- Testing base64_encode() with binary string input ---
-- Iteration 1 --
TEST PASSED
-- Iteration 2 --
TEST PASSED
-- Iteration 3 --
TEST PASSED
-- Iteration 4 --
TEST PASSED
-- Iteration 5 --
TEST PASSED
===Done===