mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-12-02 09:17:58 +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
|
|
); |