Skip to content
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

Any roadmap or planning for PHP 8 support ? #95

Closed
pounard opened this issue Dec 4, 2020 · 130 comments
Closed

Any roadmap or planning for PHP 8 support ? #95

pounard opened this issue Dec 4, 2020 · 130 comments
Assignees
Milestone

Comments

@pounard
Copy link

pounard commented Dec 4, 2020

Hello,

Is there any plans/planned date for supporting PHP 8 ?

Best regards, and thank you for all the hard work.

@pounard
Copy link
Author

pounard commented Dec 4, 2020

I should add that I'm very interested in having it, since I'm going to use it from approximately now for client projects.

@zulus
Copy link
Member

zulus commented Dec 8, 2020

It was planned during holiday, but second covid wave happen... I'll grab some time during Christmas and prepare a least basic PHP8 support (syntax checker).

I'll also need this version soon ;)

@pounard
Copy link
Author

pounard commented Dec 8, 2020

@zulus I have a question about contributing, are you modifying the CUP parser files manually for upgrading the parser ?

And also, are you are parsing types using the Identifier class, but with union type, you'll need to a case in the type:: grammar, case in which you'll need to parse an IdentifierList or some sort, I started reading the code, they are thousands of references of the Identifier class, seems hard to grasp where you use it for types and where you use it for other expressions, are you planning on specializing a bit more parsed tokens in the AST ?

I stopped at this point on sunday night, I read thousands of lines of code in PDT, I'm interesting in helping is that's possible, I'll probably ask many questions thought.

@zulus
Copy link
Member

zulus commented Dec 8, 2020

If you modify CUP file, eclipse regenerate parser during build. You can even find eclipse plugin with basic colouring/validation.

As far as I remember PHP8 require from us a lot of AST and model changes, or multiple string reparsing during code analysis (performance degradation). Due this, in last year I started working on completely fresh model based on eclipse handly, without DLTK garbage. But due world madness I haven't time to finish this.

For example DLTK model require return type as simple string. So, to support union during inference, validation, code assist etc..., split string has to be done in many different places.

@pounard
Copy link
Author

pounard commented Dec 8, 2020

For example DLTK model require return type as simple string. So, to support union during inference, validation, code assist etc..., split string has to be done in many different places.

Ouch.

As far as I remember PHP8 require from us a lot of AST and model changes

That's what I thought when I saw your current parser, I guess union types is the most invasive change, you'll need to adapt your AST too, if not for performance, at least it must be done for maintainability.

@zulus
Copy link
Member

zulus commented Dec 8, 2020

We also have two ASTs:

  1. Advance, as legacy form JDT, with basic binding, cache etc. Used by semantic colouring (like deprecated) and by some content assist features (like ctrl/cmd+2 L)
  2. Compiler, based od DLTK required for inferencing, validation, navigation etc...

Most of things we can adopt here, main problem is DLTK. Lot of thing have to be override and/or re-parsed later. This madness has to be stopped, this is why I started playing with handly.

@pounard
Copy link
Author

pounard commented Dec 8, 2020

In an ideal world, PHP core would ship with a language server using its own parser, but we can only dream of it :) Just out of curiosity, did you consider switching over a LSP based editor ? There's a few PHP LSP implementations existing, some editors use those, but I have no idea how advanced they are.

@zulus
Copy link
Member

zulus commented Dec 8, 2020

In general, what I want/plan:

  1. Drop DLTK - copy/migrate lucene search and code inference
  2. Drop WTP - use WildWebDeveloper only
  3. Use GenericEditor (LSP ready)
  4. Merge Doctrine/Twig/Symfony plugins into core as example howto extend PDT
  5. In future deliver LSP server based on PDT, similar as JDT doing

PDT have one leg in WTP (old times), second in DLTK. ~20-30% of coding now is workaround between two worlds

I didn't plan to use existing LSP, because protocol in general wasn't designed to create extensions, (for example introduce code assist for $em->getRepository()

@pounard
Copy link
Author

pounard commented Dec 8, 2020

OK, it seems a very nice plan, not so sure I can help in anything in those conditions I don't know the Eclipse platform and tooling enough for anything here... But, once the huge refactor is done, I'll probably be able to fix some bugs here and there :)

@zulus
Copy link
Member

zulus commented Dec 8, 2020

OK, it seems a very nice plan, not so sure I can help in anything in those conditions I don't know the Eclipse platform and tooling enough for anything here... But, once the huge refactor is done, I'll probably be able to fix some bugs here and there :)

In many cases it's rewrite ;)

@pounard
Copy link
Author

pounard commented Dec 8, 2020

Hey that said, I'm OK for being a beta tester of yours, if you wish, I'm very eager to test and help, and report bugs, that's what I do best 🌝

I really did write some Eclipse plugins, 14 years ago (fun story, some eclipse modeling maintainers were my teachers and mentors during my school time 14 years ago), and I guess I could after some time put my hands back in this, I'll need some time, but beta testing and debugging on unstable code would be a very good mine field to practice, I'd be glad to do that, and I'll be nice with you, I know that refactoring legacy tools is not an easy task, did that myself a lot of times in my day job.

@pounard
Copy link
Author

pounard commented Jan 21, 2021

Is this still alive ?

@ghost
Copy link

ghost commented Mar 21, 2021

yip @zulus - I'm with @pounard - is there any activity here or has the project stalled?

If so, is there any way I can help move it forward as it is such a great tool and PHP 8 brings such long awaited functionality to the table (eg. named parameters) which I for one would love to be able to take advantage of!

I'm a PHP developer so not sure if useful but happy to help any way I can.

@stanolacko
Copy link

I'm also in.

@ghost
Copy link

ghost commented Mar 24, 2021

Have just received

PHP Development Tools (PDT) 8.0.0.202007171531 org.eclipse.php.feature.group Eclipse PDT

How epic is that!! thank you!

(now if I can just manage to work out how to get my project language library from PHP 7.4 to PHP 8.0)

@pounard
Copy link
Author

pounard commented Mar 25, 2021

@rickyrocker I'm using 8.x also, but there is no PHP 8 support.

@ghost
Copy link

ghost commented Mar 25, 2021

eish - thanks @pounard

@zulus is there any way I can help move this forward? having named parameters is literally game changing for me.

@ghost
Copy link

ghost commented Mar 28, 2021

@zulus - i really don't want to hassle but it would be incredibly good if you could provide at least some form of status here. This project is I'm sure of value to a great many PHP developers and it really doesn't seem right just to leave everyone hanging regarding the way forward.

Really looking forward to hearing from you!

thanks in advance

@blackjyn
Copy link

blackjyn commented Apr 4, 2021

PHP 8 support please.... Its a shame why there are no clear info on this.
at least , show the roadmap and give some words y committee!

@zulus zulus added this to the 8.0 milestone Apr 8, 2021
@zulus
Copy link
Member

zulus commented Apr 8, 2021

OK, I finally grab some time...

@zulus zulus self-assigned this Apr 8, 2021
@ghost
Copy link

ghost commented Apr 8, 2021

@zulus excellent- I'm very very happy to help if I can, but would appreciate some guidance as to how best to go about getting involved

@tbl0605
Copy link
Contributor

tbl0605 commented Apr 21, 2021

OK, I finally grab some time...

@zulus, I'll also try to grab some time the second semester, we could start by adding support for PHP 8.0 in our parsers&lexers ;)
Since I'm not using PHP 8.0 (yet), it would be nice to list all new language features that should go in our parsers&lexers (and code formater), so at least users could use PHP 8.0 syntax.
What do you think?
Maybe in some separate issue(s)?

@ghost
Copy link

ghost commented May 19, 2021

@zulus @tbl0605 any updates - named parameter code completion remains game changing for us!

@pounard
Copy link
Author

pounard commented May 20, 2021

Actually all features of PHP 8 are game changing, I can't wait having a proper support of union types, match expression and attributes. We are starting migrating some of client projects to PHP 8, and frameworks are starting using those abundantly. Attributes mostly, as being a framework user, attributes are very import to have.

@tbl0605
Copy link
Contributor

tbl0605 commented May 20, 2021

@zulus @tbl0605 any updates - named parameter code completion remains game changing for us!

On my side, I can have a deeper look only end of June. But without any answer of @zulus I won't be able to be a big help ;)
Anyway we're only 2 developers left on PDT for now, so we wll sadly be less responsive than one or two years ago.

@pounard
Copy link
Author

pounard commented May 20, 2021

@tbl0605 I understand that, being a contributor to open source is hard. But the question we all have on our list is do you have a clear roadmap if not a deadline for this ?

@ghost
Copy link

ghost commented May 20, 2021

@tbl0605 @zulus we are also willing to look at helping fund development but I can't see any way to achieve this

@DarkNami
Copy link

Because Eclipse PDT is a IDE, not a compiler or VM ?

If developer can run 7.x source code (maximum used 7.x syntax/functions) on PHP 8.1 environment, but he/she can't maintenace source code by some PHP IDE.

Or, some PHP IDE will break if a project included some 7.x packages from composer.

Is not it sound strange ?

@stanolacko
Copy link

stanolacko commented Dec 16, 2022 via email

@DarkNami
Copy link

DarkNami commented Dec 16, 2022

Maybe Language Server Protocol is a optional solution ?
https://langserver.org/

(not sure, I am not familiar with PDT source code.)

@innologi
Copy link

Hi,

If developer can run 7.x source code (maximum used 7.x syntax/functions) on PHP 8.1 environment, but he/she can't maintenace source code by some PHP IDE.

If source code can run without issues in both 7.x and 8.1 environments, how could it not be compatible to a PHP 8.1 parser in PDT?

Or, some PHP IDE will break if a project included some 7.x packages from composer.

I don't understand. You would not set up your project's vendor packages to be interpreted/parsed as your project source code, so why would they break a PHP 8+ parser in PDT?

I would add my vote for dropping parsers for officially unsupported PHP versions. It's still possible to revert to older PDT versions if you need to maintain code that is not compatible with PHP 8+.

@DarkNami
Copy link

I may have misunderstood some things.
I thought parser was incrementally, but parser are each PHP versions independent in fact ?

(I thought single parser support base syntax (7.0) + 7.1 syntax (incremental) + 7.2 syntax (incremental) + ...)

@spider4216
Copy link

Happy holidays everyone 🎄🎄🎄 Hope we'll see PDT in 2023 with PHP 8 on board 🙏🙏🙏
It's my letter ✉️ to Santa Claus 🎅

@zulus
Copy link
Member

zulus commented Mar 14, 2023

I will need some help in upcoming months in testing if anyone is still interested

@NainzguL
Copy link

sure don't hesitate to reach me if needed. Not sure how much time I can allow you but I'll do my best !

@wakabadou
Copy link

what should we do?

@pounard
Copy link
Author

pounard commented Mar 14, 2023

I am interested as well, I'm not afraid using Eclipse in a broken state (git will always save my life anyway) !

@zulus
Copy link
Member

zulus commented Mar 14, 2023

For now I upgraded my machine, and updated everything to make sure PDT is working correctly with recent Eclipse (2022-12) and all tests passes.

Next step is to finalize my experiments (from time before my ADHD + own company freezes me completely) and push to repository one by one.

After that I'll ask You to test ;)

@merks
Copy link
Contributor

merks commented Mar 14, 2023

If there's anything releng-related for which you need help, please reach out to be personally.

@stanolacko
Copy link

Cool! Thanks @zulus !

@spider4216
Copy link

spider4216 commented Mar 15, 2023

Looking forward release 🚀

I also can participate in testing release

@aln-1
Copy link

aln-1 commented Mar 16, 2023

I will need some help in upcoming months in testing if anyone is still interested

Count me in, I'll be happy to test.

@fbastien
Copy link

Thanks! I would be glad to help testing as well :)

@dfelton
Copy link

dfelton commented Mar 21, 2023

Happy to help.

@zulus
Copy link
Member

zulus commented Apr 17, 2023

I recently uploaded nearly final version of PHP 8.0 compiler parser, so basic syntax validation should be fine now. Semantic highlighting and code formatting not working correctly

Supported 8.0 syntax:

  1. UnionTypes
  2. Match expression
  3. Named parameters
  4. Attributes
  5. Nullsafe operator
  6. Static return type
  7. Constructor property promotion

Some smaller PHP8.0 syntax changes have to be still implemented/verified on compiler parser first before I move code to DOM parser:

  1. Throw expressions
  2. Non capturing catches
  3. Variable syntax consistency
  4. Namespaced names consistency

@stanolacko
Copy link

stanolacko commented Apr 17, 2023 via email

@pounard
Copy link
Author

pounard commented Apr 18, 2023

@zulus Can we get it using something like a nightly update site or such ?

@zulus
Copy link
Member

zulus commented Apr 18, 2023

@zulus Can we get it using something like a nightly update site or such ?

Yeah, builds are done via: https://ci.eclipse.org/pdt/view/PDT/job/pdt-master/

And available under: https://download.eclipse.org/tools/pdt/updates/latest-nightly/

Recent updates in compiler parser:

  1. Throw expressions
  2. Non capturing catches
  3. Variable syntax consistency

One last thing on compiler parser level: Namespace names consistency. This is will by tricky, to keep backward compatibility with old tests

@aln-1
Copy link

aln-1 commented Apr 18, 2023

@zulus Can we get it using something like a nightly update site or such ?

Yeah, builds are done via: https://ci.eclipse.org/pdt/view/PDT/job/pdt-master/

And available under: https://download.eclipse.org/tools/pdt/updates/latest-nightly/

Recent updates in compiler parser:

  1. Throw expressions
  2. Non capturing catches
  3. Variable syntax consistency

One last thing on compiler parser level: Namespace names consistency. This is will by tricky, to keep backward compatibility with old tests

Hi,
I just installed the nightly build. Here is some quick feedback.
The following syntaxes give fault errors:

  • enum
  • readonly class
  • constructor variable with visibility (private, protected ..). Also use statements for variable classes are marked as not needed (yellow).
  • use of trait in class gives "cannot be resolved"
  • use "as" can't be resolved

@zulus
Copy link
Member

zulus commented Apr 18, 2023

For now im working on parsers, first for 8.0 (enum is from 8.1) ;) : https://www.php.net/releases/8.0/en.php

Validation will be, once I finish all parsers (8.0, 8.1, 8.2)

@aln-1
Copy link

aln-1 commented Apr 18, 2023

For now im working on parsers, first for 8.0 (enum is from 8.1) ;) : https://www.php.net/releases/8.0/en.php

Validation will be, once I finish all parsers (8.0, 8.1, 8.2)

Great!!

@stanolacko
Copy link

@zulus Excellent job! Made some few tests and 8.0 works nice.
What is missing for me, is autocomplete named attributes of functions, which can be on top of options.
Do you plan support of this help for developers?
For example setCookie example on PHP 8.0.
setCookie(name: 'Example', CTRL-Space and show all agruments to find for example expires

@spider4216
Copy link

@zulus Can we get it using something like a nightly update site or such ?

Yeah, builds are done via: https://ci.eclipse.org/pdt/view/PDT/job/pdt-master/

And available under: https://download.eclipse.org/tools/pdt/updates/latest-nightly/

Recent updates in compiler parser:

1. Throw expressions

2. Non capturing catches

3. Variable syntax consistency

One last thing on compiler parser level: Namespace names consistency. This is will by tricky, to keep backward compatibility with old tests

Thank's @zulus
Install it and start to testing

@vardumper
Copy link

vardumper commented Apr 19, 2023

Screenshot 2023-04-19 at 13 09 44

I also test with latest nightly and [experimental] php8.2 and saw that mixed is not recognised as a variable type.

@zulus
Copy link
Member

zulus commented Apr 19, 2023

I made basic infa for all recent PHP versions: fef3299

Once I finish DOM parser for PHP8.0 I'll incrementally continue on 8.1

@zulus
Copy link
Member

zulus commented Apr 19, 2023

I made umbrella tasks for each PHP version for easier tracking

I've done PHP8.0 compiler parser : 3de174d

Once I finish DOM AST nodes (they are much more complicated than compiler by design), I'll prepare DOM AST parser

I'm closing this task for now

@zulus zulus closed this as completed Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests