1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 03:03:26 +02:00

Fixed nullable handling (phpunit failure)

This commit is contained in:
Dmitry Stogov
2017-01-13 19:51:12 +03:00
parent 6eaa55db79
commit 501ff45283
2 changed files with 12 additions and 1 deletions
@@ -0,0 +1,11 @@
--TEST--
nullable class
--FILE--
<?php
function test(Foo $a = null) {
echo "ok\n";
}
test(null);
?>
--EXPECT--
ok
+1 -1
View File
@@ -801,7 +801,7 @@ static zend_always_inline zend_bool zend_check_type(
} else {
*ce = zend_fetch_class(ZEND_TYPE_NAME(type), (ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD));
if (UNEXPECTED(!*ce)) {
return 0;
return Z_TYPE_P(arg) == IS_NULL && (ZEND_TYPE_ALLOW_NULL(type) || (default_value && is_null_constant(scope, default_value)));
}
*cache_slot = (void *) *ce;
}