php-parser/test/code/parser/scalar/flexibleDocString.test
Nikita Popov 83766c8c0e Partial support for flexible heredoc/nowdoc
This only implements the token emulation part, it does not yet
handle the indentation stripping.

Emulating this feature on old PHP versions is really tough and is
not going to work perfectly, but hopefully this implementation is
"good enough".
2018-09-21 11:16:00 +02:00

47 lines
1.1 KiB
Plaintext

Flexible heredoc/nowdoc (PHP 7.3)
-----
<?php
$ary = [
<<<FOO
Test
FOO,
// Value here is wrong
<<<'BAR'
Test
BAR,
];
-----
array(
0: Stmt_Expression(
expr: Expr_Assign(
var: Expr_Variable(
name: ary
)
expr: Expr_Array(
items: array(
0: Expr_ArrayItem(
key: null
value: Scalar_String(
value: Test
)
byRef: false
)
1: Expr_ArrayItem(
key: null
value: Scalar_String(
value: Test
comments: array(
0: // Value here is wrong
)
)
byRef: false
comments: array(
0: // Value here is wrong
)
)
)
)
)
)
)