mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
Fix handling of qualified nullable parameter types
compile_typename() can't deal with TYPE_NULLABLE flags, drop it beforehand.
This commit is contained in:
parent
443da77c35
commit
1397f754c8
2 changed files with 14 additions and 0 deletions
13
Zend/tests/typehints/fq_nullable.phpt
Normal file
13
Zend/tests/typehints/fq_nullable.phpt
Normal file
|
@ -0,0 +1,13 @@
|
|||
--TEST--
|
||||
Fully-qualified nullable parameter type
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace Foo;
|
||||
function test(?\stdClass $param) {}
|
||||
test(new \stdClass);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
|
@ -5140,6 +5140,7 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */
|
|||
op_array->fn_flags |= ZEND_ACC_HAS_TYPE_HINTS;
|
||||
arg_info->allow_null = has_null_default || is_explicitly_nullable;
|
||||
|
||||
type_ast->attr &= ~ZEND_TYPE_NULLABLE;
|
||||
zend_compile_typename(type_ast, arg_info);
|
||||
|
||||
if (arg_info->type_hint == IS_VOID) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue