Skip to content

Can't print CFG of code including "include" expression #62

Closed
@driusan

Description

@driusan
<?php
require_once "foo.php";

Throws the exception

$ php bin/print.php demo.php

Control Flow Graph: 

Block#1
    Expr_Include
        expr: LITERAL<inferred:string>('foo.php')
        result: Var<inferred:unknown>#1
    Terminal_Return

Fatal error: Uncaught LogicException: Unsupported expression: Expr_Include in /home/driusan/Code/php-compiler/lib/Compiler.php:502
Stack trace:
#0 /home/driusan/Code/php-compiler/lib/Compiler.php(195): PHPCompiler\Compiler->compileExpr(Object(PHPCfg\Op\Expr\Include_), Object(PHPCompiler\Block))
#1 /home/driusan/Code/php-compiler/lib/Compiler.php(84): PHPCompiler\Compiler->compileOp(Object(PHPCfg\Op\Expr\Include_), Object(PHPCompiler\Block))
#2 /home/driusan/Code/php-compiler/lib/Compiler.php(59): PHPCompiler\Compiler->compileOps(Array, Object(PHPCompiler\Block))
#3 /home/driusan/Code/php-compiler/lib/Compiler.php(53): PHPCompiler\Compiler->compileBlock(Object(PHPCompiler\Block))
#4 /home/driusan/Code/php-compiler/lib/Compiler.php(31): PHPCompiler\Compiler->compileCfgBlock(Object(PHPCfg\Block))
#5 /home/driusan/Code/php-compiler/lib/Runtime.php(136): PHPCompiler\Compiler->compile(Object(PHPCfg\Script))
#6 /home/driusan/Code/php-compiler/bin/print.php(22): PHPCompiler\Runtime->compile(Object(PHPCfg\Script))
#7 /home/driusan in /home/driusan/Code/php-compiler/lib/Compiler.php on line 502

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions