Adding a test case for Nop causing bad new statement placement

This commit is contained in:
Ryan Weaver 2020-01-31 11:14:25 -05:00 committed by Nikita Popov
parent 88f3a669c1
commit 521addec91

View File

@ -0,0 +1,20 @@
Adding statement to Class Method containing Nop
-----
<?php
class Foo {
public function __construct()
{
// I'm just a comment
}
}
-----
$stmts[0]->stmts[0]->stmts[] = new Stmt\Expression(new Node\Expr\Variable('foo'));
-----
<?php
class Foo {
public function __construct
$foo;()
{
// I'm just a comment
}
}