derickr / vld

BSD 2-Clause "Simplified" License
464 stars 87 forks source link

about the function of traits #49

Closed jimmyleeeeee closed 4 years ago

jimmyleeeeee commented 4 years ago

Currently, when a class (MyHelloWorld) use a traits(SayWorld), there is no any opcode to show that the relationship between the function of the traits and the class (MyHelloWorld). The example code :

trait SayWorld {
    public function sayHello() {
        echo 'World!';
    }
}

class MyHelloWorld {
    use SayWorld;
}
$o = new MyHelloWorld();
$o->sayHello();

As the function of the traits (SayWorld ) can be called by the class (MyHelloWorld), there must be some infomation about this. How to print it?

derickr commented 4 years ago

VLD is primarily for dumping opcodes, and it does not try to show all the information about a class. Therefore, I think showing this information is out of scope for VLD.

jimmyleeeeee commented 4 years ago

OK. THanks for your quick answer.