]> granicus.if.org Git - php/commitdiff
Fixed possible incorrect result of type verification.
authorDmitry Stogov <dmitry@zend.com>
Tue, 15 Aug 2017 11:46:18 +0000 (14:46 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 15 Aug 2017 11:46:18 +0000 (14:46 +0300)
Zend/zend_execute.c

index a78accfb76251d02a29edf4127e86fc8afa84cf0..ae9d00684d6f9bf97c4851f3e45d8422f9df192a 100644 (file)
@@ -843,6 +843,7 @@ static zend_always_inline zend_bool zend_check_type(
                if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) {
                        return instanceof_function(Z_OBJCE_P(arg), *ce);
                }
+               return Z_TYPE_P(arg) == IS_NULL && (ZEND_TYPE_ALLOW_NULL(type) || (default_value && is_null_constant(scope, default_value)));
        } else if (EXPECTED(ZEND_TYPE_CODE(type) == Z_TYPE_P(arg))) {
                return 1;
        }