mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-12-12 00:59:49 +01:00
c3cbf07946
If call arguments or array contains comments, print it in multiline form, so that comments may be preserved.
53 lines
470 B
Plaintext
53 lines
470 B
Plaintext
Comments in arrays and function calls
|
|
-----
|
|
<?php
|
|
|
|
$arr = [
|
|
// Foo
|
|
$foo,
|
|
// Bar
|
|
$bar,
|
|
// Discarded
|
|
];
|
|
[
|
|
// Foo
|
|
$foo,
|
|
,
|
|
// Bar
|
|
$bar,
|
|
] = $arr;
|
|
foo(
|
|
// Foo
|
|
$foo,
|
|
// Bar
|
|
$bar
|
|
);
|
|
new Foo(
|
|
// Foo
|
|
$foo
|
|
);
|
|
-----
|
|
!!php7
|
|
$arr = [
|
|
// Foo
|
|
$foo,
|
|
// Bar
|
|
$bar,
|
|
];
|
|
[
|
|
// Foo
|
|
$foo,
|
|
,
|
|
// Bar
|
|
$bar,
|
|
] = $arr;
|
|
foo(
|
|
// Foo
|
|
$foo,
|
|
// Bar
|
|
$bar
|
|
);
|
|
new Foo(
|
|
// Foo
|
|
$foo
|
|
); |