-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 5 runtime support #23
Comments
Since a lot of people ask for this: I like the new features of PHP 7 and use PHP 7 in all my projects. I understand though that many do not. So if you care about this, and want to do the refactoring work (low hanging fruit really compared to other features), I will happily merge a PR, but I myself will rather concentrate on features. I would also prefer a transpilation solution if that is possible. |
I found this PHP transpiler https://github.com/jaytaph/Transphpile but I don't know if it works well. |
@batopa I would write the source in PHP 7, but before releasing transpile to PHP 5. Actually, I don't know atm if Composer supports this. I come from a Node background and on NPM it is pretty common to transpile code before releasing... |
Composer permits something similar https://getcomposer.org/doc/articles/scripts.md. |
The VS Code extension has a composer.json and the |
So we would add the transpiler as devdep and call it in a post-package-install script? |
Yes that is the idea. But frankly for me it would be preferable to have two versions of the plugin. The transpiler seems immature and use it for production seems risky to me. Having something like a stable version for PHP >= 7 and a preview version transpiled for PHP 5.6. |
I am against two versions. We should rather find a way to only transpile src, not tests, and then run the tests against the transpiled version (in CI). Only need to modify the autoloading to point to the dist folder. That way we can 100% verify everything works (well, 90% with current coverage :P). |
Meanwhile I'll have a look at transpiler to see how it works |
The issue is more complicated than I expected. The transpiler works quite well but I have some issues with anonymous classes (I found it in |
Since Im the author of that lib as well it's no problem to transpile it as well :) |
Does this mean the Language Server should run in PHP 5? Or does this mean it should be able to parse PHP 5? When people ask for PHP 5 support, they probably mean their code is in PHP 5 and think since this runs on PHP 7, their code can't be parsed / validated. Even though it seems to work just fine on my PHP 5 source files. I think having language server written as PHP 5 is useless waste of time, since this project works just fine with PHP 5 source files. Developers can easily install PHP 7 just for running the language server IMHO. |
@Ciantic this is just about running the language server in PHP so people don't have to install two versions side-by-side. Parsing PHP 5 is totally fine, and depends only on the PHPParser. As I stated, I will not put any work into this, but if someone wants to set up a transpilation solution I would merge a PR. |
Declining this because some dependencies require PHP 7 now. |
We would lose the following features:
use
statements??
operatorIs there anything like BabelJS for PHP that transpiles it?
The text was updated successfully, but these errors were encountered: