fixing cast error in #290, on php array variables for twig types