PHPSA\Compiler\Expression\Casts\ObjectCast::compile PHP Method

compile() protected method

(object) {$expr}
protected compile ( PhpParser\Node\Expr\Cast\Object_ $expr, Context $context ) : CompiledExpression
$expr PhpParser\Node\Expr\Cast\Object_
$context PHPSA\Context
return PHPSA\CompiledExpression
    protected function compile($expr, Context $context)
    {
        $compiledExpression = $context->getExpressionCompiler()->compile($expr->expr);
        if ($compiledExpression->isTypeKnown()) {
            return new CompiledExpression(CompiledExpression::OBJECT, (object) $compiledExpression->getValue());
        }
        return new CompiledExpression();
    }
ObjectCast