????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/strings/ |
Upload File : |
--TEST--
Test setlocale() function : usage variations - setting system locale = 0
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip Not valid for windows');
}
if (setlocale(LC_ALL,'en_US.utf8') === false) {
die('skip en_US.utf8 locale not available');
}
?>
--FILE--
<?php
/* Prototype : string setlocale (int $category , string $locale [,string $..] )
* : string setlocale(int $category , array $locale);
* Description: Sets locale information.Returns the new current locale , or FALSE
* if locale functionality is not implemented in this platform.
* Source code: ext/standard/string.c
*/
/* If locale is "0", the locale setting is not affected, only the current setting is returned */
echo "*** Testing setlocale() : usage variations - setting system locale = 0 ***\n";
$locale_info_before = array();
$locale_info_after = array();
//initially giving the locale
setlocale(LC_ALL,"en_US.utf8");
echo "Locale info, before setting the locale\n";
//returns current locale,before executing setlocale().
$locale_info_before = localeconv();
var_dump($locale_info_before);
//Testing setlocale() by giving locale = 0
echo "Setting system locale, category = LC_ALL and locale = 0\n";
setlocale(LC_ALL, 0);
echo "Locale info, after setting the locale\n";
//returns current locale,after executing setlocale().
$locale_info_after = localeconv();
var_dump($locale_info_after);
echo "Checking locale in the system, Expected : no change in the existing locale\n";
echo "Test ";
if($locale_info_before == $locale_info_after){
echo "PASSED.";
} else {
echo "FAILED.";
}
echo "\nDone\n";
?>
--EXPECTF--
*** Testing setlocale() : usage variations - setting system locale = 0 ***
Locale info, before setting the locale
array(18) {
["decimal_point"]=>
string(1) "."
["thousands_sep"]=>
string(1) ","
["int_curr_symbol"]=>
string(4) "USD "
["currency_symbol"]=>
string(1) "$"
["mon_decimal_point"]=>
string(1) "."
["mon_thousands_sep"]=>
string(1) ","
["positive_sign"]=>
string(0) ""
["negative_sign"]=>
string(1) "-"
["int_frac_digits"]=>
int(2)
["frac_digits"]=>
int(2)
["p_cs_precedes"]=>
int(1)
["p_sep_by_space"]=>
int(0)
["n_cs_precedes"]=>
int(1)
["n_sep_by_space"]=>
int(0)
["p_sign_posn"]=>
int(1)
["n_sign_posn"]=>
int(1)
["grouping"]=>
array(2) {
[0]=>
int(3)
[1]=>
int(3)
}
["mon_grouping"]=>
array(2) {
[0]=>
int(3)
[1]=>
int(3)
}
}
Setting system locale, category = LC_ALL and locale = 0
Locale info, after setting the locale
array(18) {
["decimal_point"]=>
string(1) "."
["thousands_sep"]=>
string(1) ","
["int_curr_symbol"]=>
string(4) "USD "
["currency_symbol"]=>
string(1) "$"
["mon_decimal_point"]=>
string(1) "."
["mon_thousands_sep"]=>
string(1) ","
["positive_sign"]=>
string(0) ""
["negative_sign"]=>
string(1) "-"
["int_frac_digits"]=>
int(2)
["frac_digits"]=>
int(2)
["p_cs_precedes"]=>
int(1)
["p_sep_by_space"]=>
int(0)
["n_cs_precedes"]=>
int(1)
["n_sep_by_space"]=>
int(0)
["p_sign_posn"]=>
int(1)
["n_sign_posn"]=>
int(1)
["grouping"]=>
array(2) {
[0]=>
int(3)
[1]=>
int(3)
}
["mon_grouping"]=>
array(2) {
[0]=>
int(3)
[1]=>
int(3)
}
}
Checking locale in the system, Expected : no change in the existing locale
Test PASSED.
Done