From bdf5b1bb8fcb8bd7d7060c6a48096bd94466ac87 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 21 Dec 2022 13:36:52 -0600 Subject: [PATCH] Revert "fix single line @php statements to not be parsed as php blocks when @endphp is also in the same file, + unit test, fixes #45330 (#45333)" This reverts commit 2427cece1d56e252e9c2673fd6f8263b2b6371e3. --- src/Illuminate/View/Compilers/BladeCompiler.php | 2 +- tests/View/Blade/BladePhpStatementsTest.php | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Illuminate/View/Compilers/BladeCompiler.php b/src/Illuminate/View/Compilers/BladeCompiler.php index 97bfe0ed5ddd..a27d977d7b05 100644 --- a/src/Illuminate/View/Compilers/BladeCompiler.php +++ b/src/Illuminate/View/Compilers/BladeCompiler.php @@ -387,7 +387,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 131a2686dbc2..8f7a9f707965 100644 --- a/tests/View/Blade/BladePhpStatementsTest.php +++ b/tests/View/Blade/BladePhpStatementsTest.php @@ -84,11 +84,4 @@ 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)); - } }