????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 3.138.123.143 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-- datefmt_parse_timestamp_code() with parse pos icu <= 4.2 --SKIPIF-- <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> <?php if(version_compare(INTL_ICU_VERSION, '4.3', '<') != 1) print 'skip'; ?> --INI-- datetime.timezone="America/Los_Angeles" --ENV-- TZ=America/Los_Angeles --FILE-- <?php /* * Test for the datefmt_parse_timestamp function with parse_pos */ function ut_main() { $locale_arr = array ( 'en_US_CA' ); $datetype_arr = array ( IntlDateFormatter::FULL, IntlDateFormatter::LONG, IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT, IntlDateFormatter::NONE ); $res_str = ''; $text_arr = array ( "Sunday, September 18, 3039 4:06:40 PM PT", "Thursday, December 18, 1969 8:49:59 AM PST", //"December 18, 1969 8:49:59 AM PST", "12/18/69 8:49 AM", "20111218 08:49 AM", "19691218 08:49 AM" ); foreach( $text_arr as $text_entry){ $res_str .= "\n------------\n"; $res_str .= "\nInput text is : $text_entry"; $res_str .= "\n------------"; foreach( $locale_arr as $locale_entry ){ $res_str .= "\nLocale is : $locale_entry"; $res_str .= "\n------------"; foreach( $datetype_arr as $datetype_entry ) { $res_str .= "\ndatetype = $datetype_entry ,timetype =$datetype_entry"; $fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry); $pos = 0; $parsed = ut_datefmt_parse( $fmt , $text_entry, $pos); if( intl_get_error_code() == U_ZERO_ERROR){ $res_str .= "\nParsed text is : $parsed; Position = $pos"; }else{ $res_str .= "\nError while parsing as: '".intl_get_error_message()."'; Position = $pos"; } } } } $res_str .= "\n"; return $res_str; } include_once( 'ut_common.inc' ); // Run the test ut_run(); ?> --EXPECT-- ------------ Input text is : Sunday, September 18, 3039 4:06:40 PM PT ------------ Locale is : en_US_CA ------------ datetype = 0 ,timetype =0 Parsed text is : 33756908800; Position = 40 datetype = 1 ,timetype =1 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 datetype = 2 ,timetype =2 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 datetype = 3 ,timetype =3 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 datetype = -1 ,timetype =-1 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 ------------ Input text is : Thursday, December 18, 1969 8:49:59 AM PST ------------ Locale is : en_US_CA ------------ datetype = 0 ,timetype =0 Parsed text is : -1149001; Position = 42 datetype = 1 ,timetype =1 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 datetype = 2 ,timetype =2 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 datetype = 3 ,timetype =3 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 datetype = -1 ,timetype =-1 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 ------------ Input text is : 12/18/69 8:49 AM ------------ Locale is : en_US_CA ------------ datetype = 0 ,timetype =0 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 datetype = 1 ,timetype =1 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 datetype = 2 ,timetype =2 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 datetype = 3 ,timetype =3 Parsed text is : -1149060; Position = 16 datetype = -1 ,timetype =-1 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 ------------ Input text is : 20111218 08:49 AM ------------ Locale is : en_US_CA ------------ datetype = 0 ,timetype =0 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 datetype = 1 ,timetype =1 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 datetype = 2 ,timetype =2 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 datetype = 3 ,timetype =3 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 8 datetype = -1 ,timetype =-1 Parsed text is : 1324226940; Position = 17 ------------ Input text is : 19691218 08:49 AM ------------ Locale is : en_US_CA ------------ datetype = 0 ,timetype =0 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 datetype = 1 ,timetype =1 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 datetype = 2 ,timetype =2 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 0 datetype = 3 ,timetype =3 Error while parsing as: 'Date parsing failed: U_PARSE_ERROR'; Position = 8 datetype = -1 ,timetype =-1 Parsed text is : -1149060; Position = 17