diff --git a/src/Illuminate/View/Compilers/BladeCompiler.php b/src/Illuminate/View/Compilers/BladeCompiler.php index 21f70b35a7a3..51b5abd69c5a 100644 --- a/src/Illuminate/View/Compilers/BladeCompiler.php +++ b/src/Illuminate/View/Compilers/BladeCompiler.php @@ -380,7 +380,7 @@ protected function storeVerbatimBlocks($value) */ protected function storePhpBlocks($value) { - return preg_replace_callback('/(?storeRawBlock(""); }, $value); } diff --git a/tests/View/Blade/BladePhpStatementsTest.php b/tests/View/Blade/BladePhpStatementsTest.php index 8f7a9f707965..131a2686dbc2 100644 --- a/tests/View/Blade/BladePhpStatementsTest.php +++ b/tests/View/Blade/BladePhpStatementsTest.php @@ -84,4 +84,11 @@ public function testStringWithEscapingDataValue() $this->assertEquals($expected, $this->compiler->compileString($string)); } + + public function testCompilationOfMixedPhpStatements() + { + $string = '@php($set = true) @php ($hello = \'hi\') @php echo "Hello world" @endphp'; + $expected = ' '; + $this->assertEquals($expected, $this->compiler->compileString($string)); + } }