I'm currently working on a project where I have to analyze PHP code and perform certain modifications to it. I stumbled upon PHP-Parser, a great library for parsing PHP code and generating an abstract syntax tree (AST). However, I'm facing a little issue and I could really use some help from the community.
What I'm trying to achieve is to extract the names of global variables from the AST and then modify them. I've looked into the PHP-Parser documentation, but I couldn't find a clear example or explanation for this specific task.
It would be really helpful if someone could guide me on how to use PHP-Parser to get the names of global variables from the AST and also provide a way to modify them. Any code snippets or examples would be greatly appreciated.
Thanks in advance!