1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-11 17:09:41 +01:00
PHP-Parser/test/code/parser/stmt/function/variadicDefaultValue.test
Nikita Popov caa5c0cc76 Graceful handling for "special" errors
Nearly all special errors are now handled gracefully, i.e. the
parser will be able to continue after encountering them. In some
cases the associated error range has been improved using the new
end attribute stack.

To achieve this the error handling code has been moved out of the
node constructors and into special methods in the parser.
2016-10-09 12:38:18 +02:00

27 lines
564 B
Plaintext

Invalid variadic function
-----
<?php
function foo(...$foo = []) {}
-----
Variadic parameter cannot have a default value from 2:24 to 2:25
array(
0: Stmt_Function(
byRef: false
name: foo
params: array(
0: Param(
type: null
byRef: false
variadic: true
name: foo
default: Expr_Array(
items: array(
)
)
)
)
returnType: null
stmts: array(
)
)
)