File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
src/Illuminate/View/Compilers Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -380,7 +380,7 @@ protected function storeVerbatimBlocks($value)
380
380
*/
381
381
protected function storePhpBlocks ($ value )
382
382
{
383
- return preg_replace_callback ('/(?<!@)@php(.*?)@endphp/s ' , function ($ matches ) {
383
+ return preg_replace_callback ('/(?<!@)@php(?! ?\()( .*?)@endphp/s ' , function ($ matches ) {
384
384
return $ this ->storeRawBlock ("<?php {$ matches [1 ]}?> " );
385
385
}, $ value );
386
386
}
Original file line number Diff line number Diff line change @@ -84,4 +84,11 @@ public function testStringWithEscapingDataValue()
84
84
85
85
$ this ->assertEquals ($ expected , $ this ->compiler ->compileString ($ string ));
86
86
}
87
+
88
+ public function testCompilationOfMixedPhpStatements ()
89
+ {
90
+ $ string = '@php($set = true) @php ($hello = \'hi \') @php echo "Hello world" @endphp ' ;
91
+ $ expected = '<?php ($set = true); ?> <?php ($hello = \'hi \'); ?> <?php echo "Hello world" ?> ' ;
92
+ $ this ->assertEquals ($ expected , $ this ->compiler ->compileString ($ string ));
93
+ }
87
94
}
You can’t perform that action at this time.
0 commit comments