--FILE--
<?php
-var_dump(strncmp("", ""));
var_dump(strncmp("", "", 100));
var_dump(strncmp("aef", "dfsgbdf", -1));
var_dump(strncmp("fghjkl", "qwer", 0));
echo "Done\n";
?>
--EXPECTF--
-Warning: strncmp() expects exactly 3 parameters, 2 given in %s on line %d
-NULL
int(0)
Warning: Length must be greater than or equal to 0 in %s on line %d
--FILE--
<?php
-var_dump(strcasecmp(""));
var_dump(strcasecmp("", ""));
var_dump(strcasecmp("aef", "dfsgbdf"));
var_dump(strcasecmp("qwe", "qwer"));
echo "Done\n";
?>
--EXPECTF--
-Warning: strcasecmp() expects exactly 2 parameters, 1 given in %s on line %d
-NULL
int(0)
int(-3)
int(-1)
--FILE--
<?php
-var_dump(strncasecmp(""));
var_dump(strncasecmp("", "", -1));
var_dump(strncasecmp("aef", "dfsgbdf", 0));
var_dump(strncasecmp("aef", "dfsgbdf", 10));
echo "Done\n";
?>
--EXPECTF--
-Warning: strncasecmp() expects exactly 3 parameters, 1 given in %s on line %d
-NULL
-
Warning: Length must be greater than or equal to 0 in %s on line %d
bool(false)
int(0)
--FILE--
<?php
-var_dump(define());
-var_dump(define("TRUE"));
-var_dump(define("TRUE", 1));
-var_dump(define("TRUE", 1, array(1)));
+try {
+ var_dump(define(array(1,2,3,4,5), 1));
+} catch (TypeError $e) {
+ echo "TypeError: ", $e->getMessage(), "\n";
+}
-var_dump(define(array(1,2,3,4,5), 1));
+var_dump(define("TRUE", 1));
var_dump(define(" ", 1));
var_dump(define("[[[", 2));
var_dump(define("test const", 3));
echo "Done\n";
?>
--EXPECTF--
-Warning: define() expects at least 2 parameters, 0 given in %s on line %d
-NULL
-
-Warning: define() expects at least 2 parameters, 1 given in %s on line %d
-NULL
+TypeError: define() expects parameter 1 to be string, array given
Notice: Constant TRUE already defined in %s on line %d
bool(false)
-
-Warning: define() expects parameter 3 to be bool, array given in %s on line %d
-NULL
-
-Warning: define() expects parameter 1 to be string, array given in %s on line %d
-NULL
bool(true)
bool(true)
bool(true)
va_end(va);
} /* }}} */
-ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...) /* {{{ */
+ZEND_API ZEND_COLD void zend_argument_count_error(const char *format, ...) /* {{{ */
{
va_list va;
char *message = NULL;
va_start(va, format);
zend_vspprintf(&message, 0, format, va);
- if (throw_exception) {
- zend_throw_exception(zend_ce_type_error, message, 0);
- } else {
- zend_error(E_WARNING, "%s", message);
- }
- efree(message);
-
- va_end(va);
-} /* }}} */
-
-ZEND_API ZEND_COLD void zend_internal_argument_count_error(zend_bool throw_exception, const char *format, ...) /* {{{ */
-{
- va_list va;
- char *message = NULL;
-
- va_start(va, format);
- zend_vspprintf(&message, 0, format, va);
- if (throw_exception) {
- zend_throw_exception(zend_ce_argument_count_error, message, 0);
- } else {
- zend_error(E_WARNING, "%s", message);
- }
+ zend_throw_exception(zend_ce_argument_count_error, message, 0);
efree(message);
va_end(va);
ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_API ZEND_COLD void zend_type_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2);
-ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
-ZEND_API ZEND_COLD void zend_internal_argument_count_error(zend_bool throw_exception, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
+ZEND_API ZEND_COLD void zend_argument_count_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2);
ZEND_COLD void zenderror(const char *error);
const char *space;
const char *class_name = get_active_class_name(&space);
- zend_internal_argument_count_error(ZEND_ARG_USES_STRICT_TYPES(), "Wrong parameter count for %s%s%s()", class_name, space, get_active_function_name());
+ zend_argument_count_error("Wrong parameter count for %s%s%s()", class_name, space, get_active_function_name());
}
/* }}} */
zend_function *active_function = EG(current_execute_data)->func;
const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
- zend_internal_argument_count_error(
- ZEND_ARG_USES_STRICT_TYPES(),
- "%s%s%s() expects %s %d parameter%s, %d given",
- class_name, \
- class_name[0] ? "::" : "", \
- ZSTR_VAL(active_function->common.function_name),
- "exactly",
- 0,
- "s",
- num_args);
- return FAILURE;
-}
-/* }}} */
-
-ZEND_API ZEND_COLD int ZEND_FASTCALL zend_wrong_parameters_none_exception(void) /* {{{ */
-{
- int num_args = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
- zend_function *active_function = EG(current_execute_data)->func;
- const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
-
- zend_internal_argument_count_error(
- 1,
+ zend_argument_count_error(
"%s%s%s() expects %s %d parameter%s, %d given",
class_name, \
class_name[0] ? "::" : "", \
zend_function *active_function = EG(current_execute_data)->func;
const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
- zend_internal_argument_count_error(
- ZEND_ARG_USES_STRICT_TYPES(),
- "%s%s%s() expects %s %d parameter%s, %d given",
- class_name, \
- class_name[0] ? "::" : "", \
- ZSTR_VAL(active_function->common.function_name),
- min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most",
- num_args < min_num_args ? min_num_args : max_num_args,
- (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
- num_args);
-}
-/* }}} */
-
-ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_exception(int min_num_args, int max_num_args) /* {{{ */
-{
- int num_args = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
- zend_function *active_function = EG(current_execute_data)->func;
- const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
-
- zend_internal_argument_count_error(
- 1,
+ zend_argument_count_error(
"%s%s%s() expects %s %d parameter%s, %d given",
class_name, \
class_name[0] ? "::" : "", \
NULL
};
- zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "%s%s%s() expects parameter %d to be %s, %s given",
- class_name, space, get_active_function_name(), num, expected_error[expected_type], zend_zval_type_name(arg));
-}
-/* }}} */
-
-ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_exception(int num, zend_expected_type expected_type, zval *arg) /* {{{ */
-{
- const char *space;
- const char *class_name = get_active_class_name(&space);
- static const char * const expected_error[] = {
- Z_EXPECTED_TYPES(Z_EXPECTED_TYPE_STR)
- NULL
- };
-
- zend_internal_type_error(1, "%s%s%s() expects parameter %d to be %s, %s given",
+ zend_type_error("%s%s%s() expects parameter %d to be %s, %s given",
class_name, space, get_active_function_name(), num, expected_error[expected_type], zend_zval_type_name(arg));
}
/* }}} */
const char *space;
const char *class_name = get_active_class_name(&space);
- zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "%s%s%s() expects parameter %d to be %s, %s given",
- class_name, space, get_active_function_name(), num, name, zend_zval_type_name(arg));
-}
-/* }}} */
-
-ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_exception(int num, char *name, zval *arg) /* {{{ */
-{
- const char *space;
- const char *class_name = get_active_class_name(&space);
-
- zend_internal_type_error(1, "%s%s%s() expects parameter %d to be %s, %s given",
+ zend_type_error("%s%s%s() expects parameter %d to be %s, %s given",
class_name, space, get_active_function_name(), num, name, zend_zval_type_name(arg));
}
/* }}} */
const char *space;
const char *class_name = get_active_class_name(&space);
- zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "%s%s%s() expects parameter %d to be a valid callback, %s",
- class_name, space, get_active_function_name(), num, error);
- efree(error);
-}
-/* }}} */
-
-ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_exception(int num, char *error) /* {{{ */
-{
- const char *space;
- const char *class_name = get_active_class_name(&space);
-
- zend_internal_type_error(1, "%s%s%s() expects parameter %d to be a valid callback, %s",
+ zend_type_error("%s%s%s() expects parameter %d to be a valid callback, %s",
class_name, space, get_active_function_name(), num, error);
efree(error);
}
const char *space;
const char *class_name = get_active_class_name(&space);
- zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "%s%s%s() expects parameter %d to be a class name derived from %s, '%s' given",
+ zend_type_error("%s%s%s() expects parameter %d to be a class name derived from %s, '%s' given",
class_name, space, get_active_function_name(), num,
ZSTR_VAL(ce_base->name), Z_STRVAL_P(arg));
*pce = NULL;
const char *space;
const char *class_name = get_active_class_name(&space);
- zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "%s%s%s() expects parameter %d to be a valid class name, '%s' given",
+ zend_type_error("%s%s%s() expects parameter %d to be a valid class name, '%s' given",
class_name, space, get_active_function_name(), num,
Z_STRVAL_P(arg));
return 0;
if (!(flags & ZEND_PARSE_PARAMS_QUIET) && (*expected_type || error)) {
const char *space;
const char *class_name = get_active_class_name(&space);
- zend_bool throw_exception =
- ZEND_ARG_USES_STRICT_TYPES() || (flags & ZEND_PARSE_PARAMS_THROW);
if (error) {
- zend_internal_type_error(throw_exception, "%s%s%s() expects parameter %d %s",
+ zend_type_error("%s%s%s() expects parameter %d %s",
class_name, space, get_active_function_name(), arg_num, error);
efree(error);
} else {
- zend_internal_type_error(throw_exception,
- "%s%s%s() expects parameter %d to be %s, %s given",
+ zend_type_error("%s%s%s() expects parameter %d to be %s, %s given",
class_name, space, get_active_function_name(), arg_num, expected_type,
zend_zval_type_name(arg));
}
if (!(flags & ZEND_PARSE_PARAMS_QUIET)) {
zend_function *active_function = EG(current_execute_data)->func;
const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
- zend_bool throw_exception = ZEND_ARG_USES_STRICT_TYPES() || (flags & ZEND_PARSE_PARAMS_THROW);
- zend_internal_argument_count_error(throw_exception, "%s%s%s() expects %s %d parameter%s, %d given",
+ zend_argument_count_error("%s%s%s() expects %s %d parameter%s, %d given",
class_name,
class_name[0] ? "::" : "",
ZSTR_VAL(active_function->common.function_name),
{
va_list va;
int retval;
- int flags = ZEND_PARSE_PARAMS_THROW;
+ int flags = 0;
va_start(va, type_spec);
retval = zend_parse_va_args(num_args, type_spec, &va, flags);
#define zend_parse_parameters_none() \
(EXPECTED(ZEND_NUM_ARGS() == 0) ? SUCCESS : zend_wrong_parameters_none_error())
#define zend_parse_parameters_none_throw() \
- (EXPECTED(ZEND_NUM_ARGS() == 0) ? SUCCESS : zend_wrong_parameters_none_exception())
+ zend_parse_parameters_none()
/* Parameter parsing API -- andrei */
+#define ZEND_PARSE_PARAMS_THROW 0 /* No longer used, zpp always uses exceptions */
#define ZEND_PARSE_PARAMS_QUIET (1<<1)
-#define ZEND_PARSE_PARAMS_THROW (1<<2)
ZEND_API int zend_parse_parameters(int num_args, const char *type_spec, ...);
ZEND_API int zend_parse_parameters_ex(int flags, int num_args, const char *type_spec, ...);
ZEND_API int zend_parse_parameters_throw(int num_args, const char *type_spec, ...);
} zend_expected_type;
ZEND_API ZEND_COLD int ZEND_FASTCALL zend_wrong_parameters_none_error(void);
-ZEND_API ZEND_COLD int ZEND_FASTCALL zend_wrong_parameters_none_exception(void);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(int min_num_args, int max_num_args);
-ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_exception(int min_num_args, int max_num_args);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(int num, zend_expected_type expected_type, zval *arg);
-ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_exception(int num, zend_expected_type expected_type, zval *arg);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(int num, char *name, zval *arg);
-ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_exception(int num, char *name, zval *arg);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int num, char *error);
-ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_exception(int num, char *error);
#define ZPP_ERROR_OK 0
#define ZPP_ERROR_FAILURE 1
(UNEXPECTED(_num_args > _max_num_args) && \
EXPECTED(_max_num_args >= 0))) { \
if (!(_flags & ZEND_PARSE_PARAMS_QUIET)) { \
- if (_flags & ZEND_PARSE_PARAMS_THROW) { \
- zend_wrong_parameters_count_exception(_min_num_args, _max_num_args); \
- } else { \
- zend_wrong_parameters_count_error(_min_num_args, _max_num_args); \
- } \
+ zend_wrong_parameters_count_error(_min_num_args, _max_num_args); \
} \
_error_code = ZPP_ERROR_FAILURE; \
break; \
if (UNEXPECTED(_error_code != ZPP_ERROR_OK)) { \
if (!(_flags & ZEND_PARSE_PARAMS_QUIET)) { \
if (_error_code == ZPP_ERROR_WRONG_CALLBACK) { \
- if (_flags & ZEND_PARSE_PARAMS_THROW) { \
- zend_wrong_callback_exception(_i, _error); \
- } else { \
- zend_wrong_callback_error(_i, _error); \
- } \
+ zend_wrong_callback_error(_i, _error); \
} else if (_error_code == ZPP_ERROR_WRONG_CLASS) { \
- if (_flags & ZEND_PARSE_PARAMS_THROW) { \
- zend_wrong_parameter_class_exception(_i, _error, _arg); \
- } else { \
- zend_wrong_parameter_class_error(_i, _error, _arg); \
- } \
+ zend_wrong_parameter_class_error(_i, _error, _arg); \
} else if (_error_code == ZPP_ERROR_WRONG_ARG) { \
- if (_flags & ZEND_PARSE_PARAMS_THROW) { \
- zend_wrong_parameter_type_exception(_i, _expected_type, _arg); \
- } else { \
- zend_wrong_parameter_type_error(_i, _expected_type, _arg); \
- } \
+ zend_wrong_parameter_type_error(_i, _expected_type, _arg); \
} \
} \
failure; \
if (UNEXPECTED(Z_TYPE_INFO_P(subject) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP2();
}
- zend_internal_type_error(EX_USES_STRICT_TYPES(), "array_key_exists() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(subject)));
+ zend_type_error("array_key_exists() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(subject)));
return IS_NULL;
}
}
init_func_run_time_cache(&func->op_array);
}
} else {
- zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
+ zend_type_error("%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error);
FREE_OP2();
- if (UNEXPECTED(EG(exception))) {
- HANDLE_EXCEPTION();
- }
- func = (zend_function*)&zend_pass_function;
- called_scope = NULL;
- object = NULL;
+ HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
ZEND_VM_C_GOTO(send_array);
}
}
- zend_internal_type_error(EX_USES_STRICT_TYPES(), "call_user_func_array() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(args)));
+ zend_type_error("call_user_func_array() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(args)));
if (ZEND_CALL_INFO(EX(call)) & ZEND_CALL_CLOSURE) {
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(call)->func));
}
if (Z_TYPE(EX(call)->This) == IS_OBJECT) {
OBJ_RELEASE(Z_OBJ(EX(call)->This));
}
- EX(call)->func = (zend_function*)&zend_pass_function;
- Z_OBJ(EX(call)->This) = NULL;
- ZEND_SET_CALL_INFO(EX(call), 0, ZEND_CALL_INFO(EX(call)) & ~ZEND_CALL_RELEASE_THIS);
FREE_UNFETCHED_OP2();
+ FREE_OP1();
+ HANDLE_EXCEPTION();
} else {
uint32_t arg_num;
HashTable *ht;
}
zval_ptr_dtor(&tmp);
}
- zend_internal_type_error(strict, "strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value)));
- ZVAL_NULL(EX_VAR(opline->result.var));
+ zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value)));
+ ZVAL_UNDEF(EX_VAR(opline->result.var));
} while (0);
}
FREE_OP1();
goto send_array;
}
}
- zend_internal_type_error(EX_USES_STRICT_TYPES(), "call_user_func_array() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(args)));
+ zend_type_error("call_user_func_array() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(args)));
if (ZEND_CALL_INFO(EX(call)) & ZEND_CALL_CLOSURE) {
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(call)->func));
}
if (Z_TYPE(EX(call)->This) == IS_OBJECT) {
OBJ_RELEASE(Z_OBJ(EX(call)->This));
}
- EX(call)->func = (zend_function*)&zend_pass_function;
- Z_OBJ(EX(call)->This) = NULL;
- ZEND_SET_CALL_INFO(EX(call), 0, ZEND_CALL_INFO(EX(call)) & ~ZEND_CALL_RELEASE_THIS);
FREE_UNFETCHED_OP(opline->op2_type, opline->op2.var);
+ FREE_OP(free_op1);
+ HANDLE_EXCEPTION();
} else {
uint32_t arg_num;
HashTable *ht;
}
zval_ptr_dtor(&tmp);
}
- zend_internal_type_error(strict, "strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value)));
- ZVAL_NULL(EX_VAR(opline->result.var));
+ zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value)));
+ ZVAL_UNDEF(EX_VAR(opline->result.var));
} while (0);
}
init_func_run_time_cache(&func->op_array);
}
} else {
- zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
+ zend_type_error("%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error);
- if (UNEXPECTED(EG(exception))) {
- HANDLE_EXCEPTION();
- }
- func = (zend_function*)&zend_pass_function;
- called_scope = NULL;
- object = NULL;
+ HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
init_func_run_time_cache(&func->op_array);
}
} else {
- zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
+ zend_type_error("%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error);
zval_ptr_dtor_nogc(free_op2);
- if (UNEXPECTED(EG(exception))) {
- HANDLE_EXCEPTION();
- }
- func = (zend_function*)&zend_pass_function;
- called_scope = NULL;
- object = NULL;
+ HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
init_func_run_time_cache(&func->op_array);
}
} else {
- zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
+ zend_type_error("%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error);
- if (UNEXPECTED(EG(exception))) {
- HANDLE_EXCEPTION();
- }
- func = (zend_function*)&zend_pass_function;
- called_scope = NULL;
- object = NULL;
+ HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
}
zval_ptr_dtor(&tmp);
}
- zend_internal_type_error(strict, "strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value)));
- ZVAL_NULL(EX_VAR(opline->result.var));
+ zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value)));
+ ZVAL_UNDEF(EX_VAR(opline->result.var));
} while (0);
}
zval_ptr_dtor_nogc(free_op1);
}
zval_ptr_dtor(&tmp);
}
- zend_internal_type_error(strict, "strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value)));
- ZVAL_NULL(EX_VAR(opline->result.var));
+ zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value)));
+ ZVAL_UNDEF(EX_VAR(opline->result.var));
} while (0);
}
size_t time_str_len = 0;
zend_error_handling error_handling;
- ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 0, 2)
+ ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
Z_PARAM_STRING(time_str, time_str_len)
Z_PARAM_OBJECT_OF_CLASS_EX(timezone_object, date_ce_timezone, 1, 0)
size_t time_str_len = 0;
zend_error_handling error_handling;
- ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 0, 2)
+ ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
Z_PARAM_STRING(time_str, time_str_len)
Z_PARAM_OBJECT_OF_CLASS_EX(timezone_object, date_ce_timezone, 1, 0)
php_timezone_obj *tzobj;
zend_error_handling error_handling;
- ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 1, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(tz)
ZEND_PARSE_PARAMETERS_END();
timelib_rel_time *reltime;
zend_error_handling error_handling;
- ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 1, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(interval_string)
ZEND_PARSE_PARAMETERS_END();
FILEINFO_DECLARE_INIT_OBJECT(object)
char resolved_path[MAXPATHLEN];
zend_error_handling zeh;
- int flags = object ? ZEND_PARSE_PARAMS_THROW : 0;
- if (zend_parse_parameters_ex(flags, ZEND_NUM_ARGS(), "|lp", &options, &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lp", &options, &file, &file_len) == FAILURE) {
RETURN_FALSE;
}
zend_long largs[6];
UErrorCode status = U_ZERO_ERROR;
int variant;
- int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0;
intl_error_reset(NULL);
// parameter number validation / variant determination
// argument parsing
if (variant <= 2) {
- if (zend_parse_parameters_ex(zpp_flags, MIN(ZEND_NUM_ARGS(), 2),
+ if (zend_parse_parameters(MIN(ZEND_NUM_ARGS(), 2),
"|z!s!", &tz_object, &locale, &locale_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlgregcal_create_instance: bad arguments", 0);
return;
}
}
- if (variant > 2 && zend_parse_parameters_ex(zpp_flags, ZEND_NUM_ARGS(),
+ if (variant > 2 && zend_parse_parameters(ZEND_NUM_ARGS(),
"lll|lll", &largs[0], &largs[1], &largs[2], &largs[3], &largs[4],
&largs[5]) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
size_t locale_len = 0;
zval* object;
Collator_object* co;
- int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0;
intl_error_reset( NULL );
object = return_value;
/* Parse parameters. */
- if( zend_parse_parameters_ex( zpp_flags, ZEND_NUM_ARGS(), "s",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&locale, &locale_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
UChar* svalue = NULL; /* UTF-16 pattern_str */
int32_t slength = 0;
IntlDateFormatter_object* dfo;
- int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0;
intl_error_reset(NULL);
object = return_value;
/* Parse parameters. */
- if (zend_parse_parameters_ex(zpp_flags, ZEND_NUM_ARGS(), "sll|zzs",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sll|zzs",
&locale_str, &locale_len, &date_type, &time_type, &timezone_zv,
&calendar_zv, &pattern_str, &pattern_str_len) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: "
zend_long style;
UChar* spattern = NULL;
int32_t spattern_len = 0;
- int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0;
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_parameters_ex( zpp_flags, ZEND_NUM_ARGS(), "sl|s",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "sl|s",
&locale, &locale_len, &style, &pattern, &pattern_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
int spattern_len = 0;
zval* object;
MessageFormatter_object* mfo;
- int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0;
intl_error_reset( NULL );
object = return_value;
/* Parse parameters. */
- if( zend_parse_parameters_ex( zpp_flags, ZEND_NUM_ARGS(), "ss",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "ss",
&locale, &locale_len, &pattern, &pattern_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
const char *locale;
size_t locale_len = 0;
zend_bool fallback = 1;
- int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0;
zval *object = return_value;
ResourceBundle_object *rb = Z_INTL_RESOURCEBUNDLE_P( object );
intl_error_reset( NULL );
- if( zend_parse_parameters_ex( zpp_flags, ZEND_NUM_ARGS(), "s!s!|b",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "s!s!|b",
&locale, &locale_len, &bundlename, &bundlename_len, &fallback ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
int call_factory = 1;
zend_error_handling zeh;
- ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 1, 4)
+ ZEND_PARSE_PARAMETERS_START(1, 4)
Z_PARAM_STRING(data_source, data_source_len)
Z_PARAM_OPTIONAL
Z_PARAM_STRING_EX(username, usernamelen, 1, 0)
zend_long size;
zend_string *bytes;
- ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 1, 1)
+ ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_LONG(size)
ZEND_PARSE_PARAMETERS_END();
zend_long max;
zend_long result;
- ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 2, 2)
+ ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_LONG(min)
Z_PARAM_LONG(max)
ZEND_PARSE_PARAMETERS_END();
php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0);
}
else {
- zend_internal_type_error(
- ZEND_ARG_USES_STRICT_TYPES(),
+ zend_type_error(
"%s() was not able to analyze the specified stream",
get_active_function_name()
);