* Enables execution in sandbox.
*/
public function enableSandbox() {
- $index = count($this->sandboxVars);
- $this->sandboxVars[$index] = $this->v;
+ $index = \count($this->sandboxVars);
+ $this->sandboxVars[$index] = [
+ 'foreachVars' => $this->foreachVars,
+ 'v' => $this->v,
+ ];
}
/**
if (empty($this->sandboxVars)) {
throw new SystemException('TemplateEngine is currently not running in a sandbox.');
}
-
- $this->v = array_pop($this->sandboxVars);
+
+ $values = \array_pop($this->sandboxVars);
+ $this->foreachVars = $values['foreachVars'];
+ $this->v = $values['v'];
}
/**