We'd like to get there eventually. Phan populates a sqlite database when analyzing code (if run with the -s flag). This allows fast runs on single file changes or patches. We're hoping to use this for things like auto-complete and finding callers for a class/method/whatever eventually.
That's awesome. If a PR was opened that added autocomplete and/or finding callers and/or refactoring (and assuming that the code is good), would you guys be open to merging it? Or would it be delayed so that the core functionality can be focused on?
We currently store method/function callers in the sqlite database (see https://github.com/etsy/phan/blob/master/src/Phan/Analyze/Br...), but aren't yet exposing an interface for getting callers. We'll want to store callers for constants, classes, properties and global variables as well.
Meanwhile, have you checked padawan ? https://github.com/mkusher/padawan.php it's a server made to be used by editors for autocompletion of PHP code (like jedi for python) it works pretty well with vim AFAIK
Just ran out of time, so mkusher did his own thing. I disagree with his direction and I think it's overly complex from a user's standpoint, but he disagrees and isn't willing to change it, so I lost interest in that project too.
Using the actual AST from the PHP interpreter is going to be a) much faster and b) much more accurate.
Analysis takes a lot of CPU and we're not doing any parallel processing. Phan itself is about 30k lines of code and takes about 1.5s for a clean run.
That being said, you should take a look at the '-s' flag for saving state to a sqlite database. After the initial run the stored state can be used to only scan changed files. For a patch with a few files changed it should be about 0.5s to run the analysis.
Phan does not attempt to make sense of things like `$class_name->$function_name()` or `$$v`. I'd be happy to see a pull request that could handle simple strings, but otherwise I imagine the best we can do is emit a warning.
I'm not sure what SIMD refers to. Can you clarify that?
> I'm not sure what SIMD refers to. Can you clarify that?
With a name like "asm" that comes as a surprise... Single Instruction Multiple Data[0] refers to low level processor instructions that are able to work across a range of data, e.g. video cards working on changing the values in a framebuffer with one instruction mapping across an entire buffer in parallel.
I'm not sure. PHP7 is pretty new so package maintainers may not have had a chance to put binary releases together. You may need to compile it yourself from https://github.com/nikic/php-ast.
https://groups.google.com/forum/#!search/allspaw$20phriend%7...