|
|
|
@ -135,7 +135,7 @@ PHP_FUNCTION(datefmt_parse) |
|
|
|
DATE_FORMAT_METHOD_INIT_VARS; |
|
|
|
|
|
|
|
/* Parse parameters. */ |
|
|
|
if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z/!", |
|
|
|
if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z!", |
|
|
|
&object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){ |
|
|
|
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse: unable to parse input params", 0 ); |
|
|
|
RETURN_FALSE; |
|
|
|
@ -145,7 +145,6 @@ PHP_FUNCTION(datefmt_parse) |
|
|
|
DATE_FORMAT_METHOD_FETCH_OBJECT; |
|
|
|
|
|
|
|
if (z_parse_pos) { |
|
|
|
ZVAL_DEREF(z_parse_pos); |
|
|
|
convert_to_long(z_parse_pos); |
|
|
|
if (ZEND_LONG_INT_OVFL(Z_LVAL_P(z_parse_pos))) { |
|
|
|
intl_error_set_code(NULL, U_ILLEGAL_ARGUMENT_ERROR); |
|
|
|
@ -159,7 +158,7 @@ PHP_FUNCTION(datefmt_parse) |
|
|
|
} |
|
|
|
internal_parse_to_timestamp( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value); |
|
|
|
if(z_parse_pos) { |
|
|
|
zval_dtor(z_parse_pos); |
|
|
|
zval_ptr_dtor(z_parse_pos); |
|
|
|
ZVAL_LONG(z_parse_pos, parse_pos); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -189,7 +188,6 @@ PHP_FUNCTION(datefmt_localtime) |
|
|
|
DATE_FORMAT_METHOD_FETCH_OBJECT; |
|
|
|
|
|
|
|
if (z_parse_pos) { |
|
|
|
ZVAL_DEREF(z_parse_pos); |
|
|
|
convert_to_long(z_parse_pos); |
|
|
|
if (ZEND_LONG_INT_OVFL(Z_LVAL_P(z_parse_pos))) { |
|
|
|
intl_error_set_code(NULL, U_ILLEGAL_ARGUMENT_ERROR); |
|
|
|
@ -203,7 +201,7 @@ PHP_FUNCTION(datefmt_localtime) |
|
|
|
} |
|
|
|
internal_parse_to_localtime( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value); |
|
|
|
if (z_parse_pos) { |
|
|
|
zval_dtor(z_parse_pos); |
|
|
|
zval_ptr_dtor(z_parse_pos); |
|
|
|
ZVAL_LONG(z_parse_pos, parse_pos); |
|
|
|
} |
|
|
|
} |
|
|
|
|