You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. First of all - great job on single Blade class.
Today had an issue with foreach loop when tried to loop through variable named $cancelReasons.
Checked out compiled file and noticed that something strange was with foreach.
As my variable contained as string then compileForeach() function using preg_match('/\( *(.*) *as *([^\)]*)/', $expression, $matches); split incorrectly @foreach ($cancelReasons as $code => $reason) part.
Don't know if this is correct way to fix it but changing preg_match part to preg_match('/\( *(.*) * as *([^\)]*)/', $expression, $matches); (added space between * as) helped solve my issue.
Maybe there is better way solving this or at least this could help someone.
The text was updated successfully, but these errors were encountered:
Hi. First of all - great job on single Blade class.
Today had an issue with
foreach
loop when tried to loop through variable named$cancelReasons
.Checked out compiled file and noticed that something strange was with
foreach
.As my variable contained
as
string thencompileForeach()
function usingpreg_match('/\( *(.*) *as *([^\)]*)/', $expression, $matches);
split incorrectly@foreach ($cancelReasons as $code => $reason)
part.Don't know if this is correct way to fix it but changing
preg_match
part topreg_match('/\( *(.*) * as *([^\)]*)/', $expression, $matches);
(added space between* as
) helped solve my issue.Maybe there is better way solving this or at least this could help someone.
The text was updated successfully, but these errors were encountered: