Merge pull request #329 from EMDM45/patch-1

Update Accessor.php
This commit is contained in:
Ivan Shalganov 2021-11-12 00:08:13 +03:00 committed by GitHub
commit 8fb0a70311
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,8 +185,12 @@ class Accessor {
} }
} }
if($tokens->is(',')) { if($tokens->is(',')) {
$tokens->skip()->need('['); $tokens->next();
if($tokens->is('[')){
$vars = $tpl->parseArray($tokens) . ' + $var'; $vars = $tpl->parseArray($tokens) . ' + $var';
}elseif($tokens->is(T_VARIABLE)){
$vars = $tpl->parseExpr($tokens) . ' + $var';
}
} else { } else {
$vars = '$var'; $vars = '$var';
} }