mirror of
https://github.com/php/php-src.git
synced 2026-04-26 01:18:19 +02:00
Merge branch 'PHP-7.0'
This commit is contained in:
@@ -10,4 +10,4 @@ foo(1);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use the scalar type 'int' as fully qualified with a leading backslash in %s on line %d
|
||||
Fatal error: Scalar type declaration 'int' must be unqualified in %s on line %d
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
namespace\int is not a valid type hint
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(namespace\int $i) {}
|
||||
test(0);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Scalar type declaration 'int' must be unqualified in %s on line %d
|
||||
+4
-2
@@ -4587,8 +4587,10 @@ static void zend_compile_typename(zend_ast *ast, zend_arg_info *arg_info) /* {{{
|
||||
zend_uchar type = zend_lookup_builtin_type_by_name(class_name);
|
||||
|
||||
if (type != 0) {
|
||||
if (ast->attr == ZEND_NAME_FQ) {
|
||||
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)));
|
||||
if (ast->attr != ZEND_NAME_NOT_FQ) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR,
|
||||
"Scalar type declaration '%s' must be unqualified",
|
||||
ZSTR_VAL(zend_string_tolower(class_name)));
|
||||
}
|
||||
arg_info->type_hint = type;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user