Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

PHP 7.4 updates #370

Closed
wants to merge 15 commits into from
Closed

PHP 7.4 updates #370

wants to merge 15 commits into from

Conversation

KapitanOczywisty
Copy link
Contributor

@KapitanOczywisty KapitanOczywisty commented Aug 31, 2019

Updates for PHP 7.4

New PRs with parts of this.



All functions are now implemented, you can test and give feedback ;)

For testing I've merged my other pull requests in: KapitanOczywisty:merge-all

For vscode you can get preview extension here:

Description of the Change

Syntax

  • Arrow functions rfc
    • syntax
    • test spec
  • Numeric Literal Separator rfc
    • syntax
    • test spec
  • Spread Operator in Array Expression rfc
    • basic spread syntax (spread is not supported at all)
    • test spec
  • Typed Properties 2.0 rfc
    • syntax
    • test spec
  • Null Coalescing Assignment Operator rfc
    • syntax
    • test spec
    • +missing Exponentiation Operator

Definitions

  • weakrefs (already supported) rfc
  • FFI - Foreign Function Interface rfc
  • Reflection for references rfc
  • New custom object serialization mechanism rfc

changes prior PHP 7.4 (not updated before)

  • iterable pseudo-type rfc
  • anonymous classes rfc
    • syntax
    • test spec (shares most of its syntax with classes)
  • Sodium - functions, constants, classes
  • Many functions and constants partially added in b2510bc
  • Password Hashing - Add constants
  • CURL - update constants current / proposed regex
  • GD - add constants
  • LDAP - add constants
  • PGSQL - add constants
  • PCNTL - add constants source

No more definitions in this pull-request, I'will provide proposition for major update in separate issue

To think about

  • C syntax inside FFI functions rfc

Alternate Designs

fn got scope storage.type.function.php alternative: storage.type.fn.php
=> got scope punctuation.definition.arrow.php alternative: ??
_ did not get own scope in numbers, if necessary punctuation.separator.literal.underscore.php or similar could be added

Current scopes

Arrow functions

Test code: fn($x) => $x;

0: fn scopes: source.php meta.function.closure.php storage.type.function.php
1: ( scopes: source.php meta.function.closure.php punctuation.definition.parameters.begin.bracket.round.php
2: $ scopes: source.php meta.function.closure.php meta.function.parameters.php meta.function.parameter.no-default.php variable.other.php punctuation.definition.variable.php
3: x scopes: source.php meta.function.closure.php meta.function.parameters.php meta.function.parameter.no-default.php variable.other.php
4: ) scopes: source.php meta.function.closure.php punctuation.definition.parameters.end.bracket.round.php
5: scopes: source.php meta.function.closure.php
6: => scopes: source.php meta.function.closure.php punctuation.definition.arrow.php
7: scopes: source.php
8: $ scopes: source.php variable.other.php punctuation.definition.variable.php
9: x scopes: source.php variable.other.php
10: ; scopes: source.php punctuation.terminator.expression.php

Anonymous classes

Test code: $a = new class {};

0: $ scopes: source.php variable.other.php punctuation.definition.variable.php
1: a scopes: source.php variable.other.php
2: scopes: source.php
3: = scopes: source.php keyword.operator.assignment.php
4: scopes: source.php
5: new scopes: source.php meta.class.php keyword.other.new.php
6: scopes: source.php meta.class.php
7: class scopes: source.php meta.class.php storage.type.class.php
8: scopes: source.php meta.class.php
9: { scopes: source.php meta.class.php punctuation.definition.class.begin.bracket.curly.php
10: } scopes: source.php meta.class.php punctuation.definition.class.end.bracket.curly.php
11: ; scopes: source.php punctuation.terminator.expression.php

Benefits

Compatibility with php 7.4

Possible Drawbacks

none

Applicable Issues

none

@KapitanOczywisty KapitanOczywisty marked this pull request as ready for review September 3, 2019 12:37
@KapitanOczywisty
Copy link
Contributor Author

@rsese Like with others - ready for review ;)

@rsese
Copy link

rsese commented Sep 10, 2019

Hey @KapitanOczywisty! Thanks again for the contribution - we looked at this one today and I made a bad assumption that 7.4 was already released, sorry about that. We poked around and see the release date seems to be end of November 2019.

For the language packages we usually wait till the language features are generally available so this isn't something that would be reviewed before then.

Additionally, with a change as large as this there was a concern about maintenance since there's currently not a lot of PHP expertise on the team right now. If this was merged, would you be around to help with followup issues related to this PR?

@KapitanOczywisty
Copy link
Contributor Author

KapitanOczywisty commented Sep 10, 2019

@rsese PHP 7.4 is in the Release Candidate stage, so features are fixed by now and only bug fixes will be deployed before full 7.4.0 release. Also there aren't any backward incompatible changes in this patch, no existing test was harmed. Moreover, I've skipped more messy changes for this PR (e.g. constants are a bit outdated and in wrong groups). In my opinion it's safe to merge this PR sooner. If you (team) can merge other two PR before this I would solve conflicts which will probably arise.

If this was merged, would you be around to help with followup issues related to this PR?

Of course, I'm following this repo, but you can also dm me on slack.

@KapitanOczywisty
Copy link
Contributor Author

@rsese PHP 7.4 is now live :)

@rsese
Copy link

rsese commented Dec 3, 2019

Thanks for the reminder! ⚡ I'll share this with the maintainers for you.

@lee-dohm
Copy link
Contributor

Since this is a huge PR and there are conflicts, would you mind closing this PR and breaking it up into a series of smaller PRs to make it more manageable for our team?

@KapitanOczywisty
Copy link
Contributor Author

@lee-dohm I can split this PR, but this can take me a while. Conflicts are now resolved if meanwhile you would want to go with this anyway. I'm using this in vscode since a few months without any problems.

@KapitanOczywisty
Copy link
Contributor Author

@lee-dohm Made 4 new PRs #377 #378 #379 #380. Other definitions are waiting for merge of these 4.

@lee-dohm
Copy link
Contributor

lee-dohm commented Jan 6, 2020

Thanks for the work you've put in on this! I've added the four related PRs to the queue to be reviewed. Since this PR isn't going to be merged in its current form, I'm going to go ahead and close it.

@lee-dohm lee-dohm closed this Jan 6, 2020
@KapitanOczywisty KapitanOczywisty deleted the php74 branch December 14, 2022 22:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants