case PhpParser\Node\Stmt\If_::class: $cond = $this->evaluate($node->cond); if ($cond['value']) { foreach ($node->stmts as $stmt) { $this->evaluate($stmt); } } return; case PhpParser\Node\Expr\ConstFetch::class: if ($node->name->toString() === 'true') { return ['value' => true]; } elseif ($node->name->toString() === 'false') { return ['value' => false]; } throw new Exception("no such const");