????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 18.119.110.206 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/intl/tests/ |
Upload File : |
--TEST-- msgfmt_format() with named subpatterns --SKIPIF-- <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); if (version_compare(INTL_ICU_VERSION, '4.8') < 0) die('skip for ICU 4.8+'); --FILE-- <?php /* * Format a number using misc locales/patterns. */ function ut_main() { $pattern=<<<_MSG_ {gender_of_host, select, female {{num_guests, plural, offset:1 =0 {{host} does not give a party.} =1 {{host} invites {guest} to her party.} =2 {{host} invites {guest} and one other person to her party.} other {{host} invites {guest} as one of the # people invited to her party.}}} male {{num_guests, plural, offset:1 =0 {{host} does not give a party.} =1 {{host} invites {guest} to his party.} =2 {{host} invites {guest} and one other person to his party.} other {{host} invites {guest} as one of the # people invited to his party.}}} other {{num_guests, plural, offset:1 =0 {{host} does not give a party.} =1 {{host} invites {guest} to their party.} =2 {{host} invites {guest} and one other person to their party.} other {{host} invites {guest} as one of the # people invited to their party.}}}} _MSG_; $args = array( array('gender_of_host' => 'female', 'num_guests' => 0, 'host' => 'Alice', 'guest' => 'Bob'), array('gender_of_host' => 'male', 'num_guests' => 1, 'host' => 'Alice', 'guest' => 'Bob'), array('gender_of_host' => 'none', 'num_guests' => 2, 'host' => 'Alice', 'guest' => 'Bob'), array('gender_of_host' => 'female', 'num_guests' => 27, 'host' => 'Alice', 'guest' => 'Bob'), ); $str_res = ''; $fmt = ut_msgfmt_create( 'en_US', $pattern ); if(!$fmt) { $str_res .= dump(intl_get_error_message())."\n"; return $str_res; } foreach ($args as $arg) { $str_res .= dump( ut_msgfmt_format($fmt, $arg) ). "\n"; $str_res .= dump( ut_msgfmt_format_message('en_US', $pattern, $arg) ) . "\n"; } return $str_res; } include_once( 'ut_common.inc' ); // Run the test ut_run(); ?> --EXPECT-- 'Alice does not give a party.' 'Alice does not give a party.' 'Alice invites Bob to his party.' 'Alice invites Bob to his party.' 'Alice invites Bob and one other person to their party.' 'Alice invites Bob and one other person to their party.' 'Alice invites Bob as one of the 26 people invited to her party.' 'Alice invites Bob as one of the 26 people invited to her party.'