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

[PHP] PHP 8.0 new syntax #2275

Merged
merged 23 commits into from
Jul 21, 2020
Merged

[PHP] PHP 8.0 new syntax #2275

merged 23 commits into from
Jul 21, 2020

Conversation

jfcherng
Copy link
Collaborator

@jfcherng jfcherng commented Feb 14, 2020

@jfcherng jfcherng force-pushed the feat-php-8 branch 2 times, most recently from 2391691 to cd56bac Compare February 19, 2020 02:13
@jfcherng jfcherng force-pushed the feat-php-8 branch 6 times, most recently from 31d8d4b to 0c1d9ce Compare April 11, 2020 23:07
@jfcherng jfcherng force-pushed the feat-php-8 branch 9 times, most recently from 73673c6 to 6b011a2 Compare April 21, 2020 10:22
@jfcherng jfcherng force-pushed the feat-php-8 branch 3 times, most recently from dabc21e to 16d4221 Compare June 22, 2020 05:39
@jfcherng jfcherng force-pushed the feat-php-8 branch 3 times, most recently from 5a15884 to 43c8cd3 Compare July 15, 2020 09:52
@wbond
Copy link
Member

wbond commented Jul 15, 2020

Based on your comment, this shouldn't really be reviewed until August, right?

@jfcherng
Copy link
Collaborator Author

jfcherng commented Jul 15, 2020

Based on your comment, this shouldn't really be reviewed until August, right?

Correct but I don't mind creating another PR if you would like to merge this one now. All known PHP 8 features currently should've been done. I am not sure whether there will be more features to be added by August.

@jfcherng jfcherng force-pushed the feat-php-8 branch 2 times, most recently from 1304e44 to a4882bd Compare July 17, 2020 15:02
jfcherng added 19 commits July 21, 2020 11:52
https://wiki.php.net/rfc/str_contains

Signed-off-by: Jack Cherng <jfcherng@gmail.com>
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
php/php-src#4769

Signed-off-by: Jack Cherng <jfcherng@gmail.com>
https://wiki.php.net/rfc/token_as_object

Signed-off-by: Jack Cherng <jfcherng@gmail.com>
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
Fixes sublimehq#991

Signed-off-by: Jack Cherng <jfcherng@gmail.com>
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
https://wiki.php.net/rfc/named_params

Signed-off-by: Jack Cherng <jfcherng@gmail.com>
php/php-src#5427

Signed-off-by: Jack Cherng <jfcherng@gmail.com>
php/php-src#5216

Signed-off-by: Jack Cherng <jfcherng@gmail.com>
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
Copy link
Member

@wbond wbond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks generally good to me - just some section scope fixes and I will be ready to merge.

PHP/PHP Source.sublime-syntax Outdated Show resolved Hide resolved
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
@wbond wbond merged commit 9532475 into sublimehq:master Jul 21, 2020
@wbond
Copy link
Member

wbond commented Jul 21, 2020

Awesome, thanks for all of these updates!

@jfcherng jfcherng deleted the feat-php-8 branch July 21, 2020 14:17
@jfcherng jfcherng changed the title [WIP][PHP] PHP 8.0 new syntax [PHP] PHP 8.0 new syntax Jul 21, 2020
mitranim pushed a commit to mitranim/Packages that referenced this pull request Mar 25, 2022
* [PHP] Add some built-in classes and constants

Classes:

ArgumentCountError
ArithmeticError
CompileError
DivisionByZeroError
Error
ParseError
Stringable
TypeError
ValueError
WeakMap
WeakReference

---

Constants:

FILTER_VALIDATE_BOOL

---

https://github.com/symfony/polyfill-php80
https://wiki.php.net/rfc/stringable
https://wiki.php.net/rfc/weak_maps
https://www.php.net/manual/en/reserved.exceptions.php
https://www.php.net/manual/en/spl.exceptions.php

* [PHP] Add support for union types

https://wiki.php.net/rfc/union_types_v2

* [PHP] Add support for "static" return type

https://wiki.php.net/rfc/static_return_type

* [PHP] Add core function: str_contains

https://wiki.php.net/rfc/str_contains

* [PHP] Add core function: get_debug_type

* [PHP] Add built-in class: DateTimeImmutable, DateTimeInterface

* [PHP] Add core function: fdiv

php/php-src#4769

* [PHP] Add built-in class: PhpToken

https://wiki.php.net/rfc/token_as_object

* [PHP] Add core function: str_starts_with, str_ends_with

https://wiki.php.net/rfc/add_str_starts_with_and_ends_with_functions

* [PHP] Add support for short attributes ("@@")

https://wiki.php.net/rfc/attributes_v2
https://wiki.php.net/rfc/attribute_amendments
https://wiki.php.net/rfc/shorter_attribute_syntax

* [PHP] Add support for "mixed" type hinting

https://wiki.php.net/rfc/mixed_type_v2

* [PHP] Add support for constructor property promotion

https://wiki.php.net/rfc/constructor_promotion

* [PHP] Extract visibility modifier as a variable

* [PHP] Add missing constant: DNS_CAA

Fixes sublimehq#991

* [PHP] Add support for "match" expression

https://wiki.php.net/rfc/match_expression_v2

* [PHP] Add snippet: fn ...

* [PHP] Add snippet: match ...

* [PHP] Add support for named arguments

https://wiki.php.net/rfc/named_params

* [PHP] Add support for nullsafe operator

https://wiki.php.net/rfc/nullsafe_operator

* [PHP] Add core function: get_resource_id

php/php-src#5427

* [PHP] Add built-in class: InternalIterator

php/php-src#5216

* [PHP] Syntax definition use "version: 2"

* [PHP] Fix punctuation scopes have no begin/end
@willrowe
Copy link
Contributor

@jfcherng I just noticed that named parameters are not working for function calls when they are closures stored in an array. Example:

$array = [
    'callback' => function ($first, $second) {
        echo "{$first}, {$second}";
    },
];

$array['callback'](first: 'first', second: 'second');

The closing parentheses is not highlighted correctly:
Screenshot 2024-02-28 at 22 26 17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[PHP] DNS_CAA type constant missing from PHP/PHP Source.sublime-syntax
3 participants