1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-05 21:38:59 +01:00
PHP-Parser/test/code/formatPreservation/listRemoval.test
2017-12-26 21:14:36 +01:00

41 lines
528 B
Plaintext

Removing from list nodes
-----
<?php $foo; $bar; $baz;
-----
array_splice($stmts, 1, 1, []);
-----
<?php $foo; $baz;
-----
<?php
function foo(
$a,
$b,
$c
) {}
-----
array_pop($stmts[0]->params);
-----
<?php
function foo(
$a,
$b
) {}
-----
<?php
function foo(
$a,
$b,
$c
) {}
-----
array_pop($stmts[0]->params);
$stmts[0]->params[] = new Node\Param(new Expr\Variable('x'));
$stmts[0]->params[] = new Node\Param(new Expr\Variable('y'));
-----
<?php
function foo(
$a,
$b,
$x,
$y
) {}