mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Merge branch 'PHP-7.0'
This commit is contained in:
commit
06bcaf98c5
@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Fully qualified (leading backslash) type names must fail
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function foo(\array $foo) {
|
||||
var_dump($foo);
|
||||
}
|
||||
foo(1);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use the builtin type 'array' as fully qualified with a leading backslash in %s on line %d
|
@ -10,4 +10,4 @@ foo(1);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use the builtin type 'int' as fully qualified with a leading backslash in %s on line %d
|
||||
Fatal error: Cannot use the scalar type 'int' as fully qualified with a leading backslash in %s on line %d
|
||||
|
@ -4588,7 +4588,7 @@ static void zend_compile_typename(zend_ast *ast, zend_arg_info *arg_info) /* {{{
|
||||
|
||||
if (type != 0) {
|
||||
if (ast->attr == ZEND_NAME_FQ) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use the builtin type '%s' as fully qualified with a leading backslash", ZSTR_VAL(zend_string_tolower(class_name)));
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use the scalar type '%s' as fully qualified with a leading backslash", ZSTR_VAL(zend_string_tolower(class_name)));
|
||||
}
|
||||
arg_info->type_hint = type;
|
||||
} else {
|
||||
|
@ -643,12 +643,6 @@ optional_type:
|
||||
type:
|
||||
T_ARRAY { $$ = zend_ast_create_ex(ZEND_AST_TYPE, IS_ARRAY); }
|
||||
| T_CALLABLE { $$ = zend_ast_create_ex(ZEND_AST_TYPE, IS_CALLABLE); }
|
||||
| T_NS_SEPARATOR T_ARRAY
|
||||
{ $$ = NULL; zend_error_noreturn(E_COMPILE_ERROR,
|
||||
"Cannot use the builtin type 'array' as fully qualified with a leading backslash"); }
|
||||
| T_NS_SEPARATOR T_CALLABLE
|
||||
{ $$ = NULL; zend_error_noreturn(E_COMPILE_ERROR,
|
||||
"Cannot use the builtin type 'callable' as fully qualified with a leading backslash"); }
|
||||
| name { $$ = $1; }
|
||||
;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user