SonataAdminBundle: Twig Cache file generates Parse Error: syntax error
I get a strange debug error for some days now with dev-master. When trying to access a sonata admin list view I get:
request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException: “Parse Error: syntax error, unexpected ‘.’, expecting ‘&’ or variable (T_VARIABLE)” at /app/cache/prod/twig/a7/a7a9af7119e75eb8391ea0c72b3b43e98ddf88c723e92565488abffefeb9c3fe.php line 253
Looking at the cache file:
// line 3
public function getattributes($__attributes__ = null, ...$__varargs__)
{
$context = $this->env->mergeGlobals(array(
"attributes" => $__attributes__,
"varargs" => $__varargs__,
));
$blocks = array();
ob_start();
I’m not sure if this is Sonata Admin related or if it is a pure twig issue, @twigphp?
As soon as I remove the cache files manually and reload the page - not clearing cache via command - everything is fine.
The lines now look like this:
// line 3
public function getattributes($__attributes__ = null)
{
$context = $this->env->mergeGlobals(array(
"attributes" => $__attributes__,
"varargs" => func_num_args() > 1 ? array_slice(func_get_args(), 1) $
));
$blocks = array();
ob_start();
Any idea?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 51 (50 by maintainers)
Ha!!! 50606!!! For PROD cli! There’s your bug!
Well he’s wrong obviously. 50530 should be what you get in CLI (and in web too, because if you use different versions of php for web and cli, you’re going to have a bad time).