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.
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.