Skip to content

Commit

Permalink
PHP8.2: support property in const expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Feb 28, 2023
1 parent d611a46 commit 5ac11c7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/Fixtures/Integration/misc/PHP8_2.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ final readonly class Foo
public string $prop;
}

// https://wiki.php.net/rfc/fetch_property_in_const_expressions
enum A: string {
case B = 'B';
const C = [self::B->value => self::B];
const D = self::B?->value;
}

// https://wiki.php.net/rfc/null-false-standalone-types
class FalseNull
{
Expand Down Expand Up @@ -97,6 +104,13 @@ READONLY final class Foo
public string $prop;
}

// https://wiki.php.net/rfc/fetch_property_in_const_expressions
enum A: string {
case B = 'B';
const C = [self::B->value => self::B];
const D = self::B?->value;
}

// https://wiki.php.net/rfc/null-false-standalone-types
class FalseNull {
private FALSE $a = FALSE;
Expand Down

0 comments on commit 5ac11c7

Please sign in to comment.