Skip to content

Scan op_array->literals for class and function dependencies #135

@dktapps

Description

@dktapps

A possible rather simple solution to issues like #111 and #115.

My initial thought was to scan the op_array for opcodes like NEW, INIT_FCALL etc to find dependencies. However, these opcodes all have different operand layouts, making it particularly inconvenient to retrieve dependencies.

A simpler option, though a bit uglier, is to just scan op_array->literals for IS_STRING zvals and then check if there are any functions or classes in the current file with the same name. This might end up copying some irrelevant stuff in some cases (if a user string happens to have the same name as a function declared in the current file), but would probably be much more robust and require less maintenance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions