summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-11-25 15:40:08 +0300
committerDmitry Stogov <dmitry@zend.com>2014-11-25 15:40:08 +0300
commit83ce1d9a785eac447145099d0f501212cbc0f786 (patch)
treece99984815c490bd8d656b9774aa67b4ebb58e3a /Zend/zend_execute.c
parent0e3771b63150d1cde7883d21fc7a3c8c99cdde46 (diff)
downloadphp-git-83ce1d9a785eac447145099d0f501212cbc0f786.tar.gz
Revert "Merge remote-tracking branch 'origin/PHP-5.6'"
This reverts commit 38229d13d14bb0bda736d52a9a4f25c121445692, reversing changes made to 77f172725a37c8ddee750bf6970529a1570fbc86.
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 5274f100e1..d6f551bcdf 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -574,17 +574,7 @@ ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, uin
}
}
-static inline int zend_arg_allows_null(zend_bool allow_null, zval *default_value TSRMLS_DC)
-{
- if (allow_null < 2 || !default_value) {
- return allow_null;
- }
-
- /* assuming update_constant_ex done before */
- return Z_TYPE_P(default_value) == IS_NULL;
-}
-
-static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zval *defaultval TSRMLS_DC)
+static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg TSRMLS_DC)
{
zend_arg_info *cur_arg_info;
char *need_msg;
@@ -611,18 +601,18 @@ static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg,
if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "instance of ", Z_OBJCE_P(arg)->name->val, arg TSRMLS_CC);
}
- } else if (Z_TYPE_P(arg) != IS_NULL || !zend_arg_allows_null(cur_arg_info->allow_null, defaultval TSRMLS_CC)) {
+ } else if (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null) {
need_msg = zend_verify_arg_class_kind(cur_arg_info, &class_name, &ce TSRMLS_CC);
zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, zend_zval_type_name(arg), "", arg TSRMLS_CC);
}
} else if (cur_arg_info->type_hint) {
if (cur_arg_info->type_hint == IS_ARRAY) {
ZVAL_DEREF(arg);
- if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !zend_arg_allows_null(cur_arg_info->allow_null, defaultval TSRMLS_CC))) {
+ if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", zend_zval_type_name(arg), "", arg TSRMLS_CC);
}
} else if (cur_arg_info->type_hint == IS_CALLABLE) {
- if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !zend_arg_allows_null(cur_arg_info->allow_null, defaultval TSRMLS_CC))) {
+ if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", zend_zval_type_name(arg), "", arg TSRMLS_CC);
}
#if ZEND_DEBUG