php-parser/test/code/parser/stmt/namespace/outsideStmt.test
Nikita Popov 719ca71d4a Distinguish declare(); and declare(){}
It makes semantic difference and the latter form is actually
forbidden for strict_types.

This sets Declare->stmts to null for the body-less case.
2015-12-07 12:12:00 +01:00

36 lines
579 B
Plaintext

Some statements may occur outside of namespaces
-----
<?php
declare(A='B');
namespace B {
}
__halt_compiler()
?>
Hi!
-----
array(
0: Stmt_Declare(
declares: array(
0: Stmt_DeclareDeclare(
key: A
value: Scalar_String(
value: B
)
)
)
stmts: null
)
1: Stmt_Namespace(
name: Name(
parts: array(
0: B
)
)
stmts: array(
)
)
2: Stmt_HaltCompiler(
remaining: Hi!
)
)