Now that this throws an exception, the call frame cleanup will be
handled by exception handling -- remove it here to avoid double
frees.
--- /dev/null
+--TEST--
+call_user_func_array() generating TypeError
+--FILE--
+<?php
+class drv {
+ function func() {
+ }
+}
+
+$drv = new drv;
+try {
+ call_user_func_array(array($drv, 'func'), null);
+} catch (TypeError $e) {
+ echo $e->getMessage(), "\n";
+}
+?>
+--EXPECT--
+call_user_func_array() expects parameter 2 to be array, null given
}
}
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));
- } else if (ZEND_CALL_INFO(EX(call)) & ZEND_CALL_RELEASE_THIS) {
- OBJ_RELEASE(Z_OBJ(EX(call)->This));
- }
FREE_UNFETCHED_OP2();
FREE_OP1();
HANDLE_EXCEPTION();
}
}
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));
- } else if (ZEND_CALL_INFO(EX(call)) & ZEND_CALL_RELEASE_THIS) {
- OBJ_RELEASE(Z_OBJ(EX(call)->This));
- }
FREE_UNFETCHED_OP(opline->op2_type, opline->op2.var);
FREE_OP(opline->op1_type, opline->op1.var);
HANDLE_EXCEPTION();