1Handling of inline HTML 2----- 3<?php 4 5function test() { 6 ?>Foo<?php 7} 8----- 9$stmts[0]->setAttribute('origNode', null); 10----- 11<?php 12 13function test() 14{ 15 ?>Foo<?php 16} 17----- 18<?php 19 20function test() { 21 foo(); 22 ?>Bar<?php 23 baz(); 24} 25----- 26// TODO Fix broken result 27$stmts[0]->stmts[2] = $stmts[0]->stmts[1]; 28----- 29<?php 30 31function test() { 32 foo(); 33 ?>Bar<?php 34 Bar 35} 36----- 37<?php 38 39function test() { 40 foo(); 41 ?>Bar<?php 42 baz(); 43} 44----- 45// TODO Preserve formatting 46$stmts[0]->stmts[1] = $stmts[0]->stmts[2]; 47----- 48<?php 49 50function test() 51{ 52 foo(); 53 baz(); 54 baz(); 55} 56----- 57<?php 58 59function test() { 60 foo(); 61 ?>Bar<?php 62 baz(); 63} 64----- 65// TODO Preserve formatting 66unset($stmts[0]->stmts[2]); 67----- 68<?php 69 70function test() 71{ 72 foo(); 73 ?>Bar<?php 74} 75----- 76<?php 77 78function test() { 79 foo(); 80 ?>Bar<?php 81 baz(); 82} 83----- 84// TODO Preserve formatting 85array_splice($stmts[0]->stmts, 0, 1, []); 86----- 87<?php 88 89function test() 90{ 91 ?>Bar<?php 92 baz(); 93} 94----- 95<?php 96 97function test() { 98 foo(); 99 ?>Bar<?php 100 baz(); 101} 102----- 103// TODO Preserve formatting 104array_splice($stmts[0]->stmts, 1, 1, []); 105----- 106<?php 107 108function test() 109{ 110 foo(); 111 baz(); 112} 113----- 114 115 116<?php $x; 117----- 118/* Do nothing, but make sure leading newlines are preserved. */ 119----- 120 121 122<?php $x; 123