mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-12-13 01:47:22 +01:00
719ca71d4a
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.
60 lines
1.1 KiB
Plaintext
60 lines
1.1 KiB
Plaintext
Declare
|
|
-----
|
|
<?php
|
|
|
|
declare (X='Y');
|
|
|
|
declare (A='B', C='D') {}
|
|
|
|
declare (A='B', C='D'):
|
|
enddeclare;
|
|
-----
|
|
array(
|
|
0: Stmt_Declare(
|
|
declares: array(
|
|
0: Stmt_DeclareDeclare(
|
|
key: X
|
|
value: Scalar_String(
|
|
value: Y
|
|
)
|
|
)
|
|
)
|
|
stmts: null
|
|
)
|
|
1: Stmt_Declare(
|
|
declares: array(
|
|
0: Stmt_DeclareDeclare(
|
|
key: A
|
|
value: Scalar_String(
|
|
value: B
|
|
)
|
|
)
|
|
1: Stmt_DeclareDeclare(
|
|
key: C
|
|
value: Scalar_String(
|
|
value: D
|
|
)
|
|
)
|
|
)
|
|
stmts: array(
|
|
)
|
|
)
|
|
2: Stmt_Declare(
|
|
declares: array(
|
|
0: Stmt_DeclareDeclare(
|
|
key: A
|
|
value: Scalar_String(
|
|
value: B
|
|
)
|
|
)
|
|
1: Stmt_DeclareDeclare(
|
|
key: C
|
|
value: Scalar_String(
|
|
value: D
|
|
)
|
|
)
|
|
)
|
|
stmts: array(
|
|
)
|
|
)
|
|
) |