ircmaxell/php-cfg

Class definition lack class name

quanyang opened this issue · 1 comments

Example:

class NameOfClass {
    function doSomething() {
     echo "Hello World";
    }
}
$obj = new NameOfClass();

Output:

Block#1
    Stmt_Class
        stmts: Block#2
    Expr_New
        class: LITERAL('NameOfClass')
        result: Var#2
    Expr_Assign
        var: Var#3<$obj>
        expr: Var#2
        result: Var#5

Block#2
    Stmt_ClassMethod<doSomething>
        stmts: Block#3

Block#3
    Terminal_Echo
        expr: LITERAL('Hello World')

In this case you wouldn't be able to trace NameOfClass back to the class definition.

nikic commented

Fixed by 23b0791.