History log of /PHP-Parser/lib/PhpParser/Parser/Php7.php (Results 1 – 25 of 175)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 9c7a3f8d 08-Oct-2024 Nikita Popov

Support declaring functions with name exit/die

For use in stubs.

Fixes #1030.


# aedfcc23 21-Sep-2024 Nikita Popov

Include trailing semicolon in GroupUse

Fixes https://github.com/nikic/PHP-Parser/issues/1026.


# b493c51c 31-Aug-2024 Nikita Popov

[8.4] Add support for asymmetric visibility modifiers

Represented using new PRIVATE_SET, PROTECTED_SET and PUBLIC_SET
bits in Modifiers.

RFC: https://wiki.php.net/rfc/asymmetric

[8.4] Add support for asymmetric visibility modifiers

Represented using new PRIVATE_SET, PROTECTED_SET and PUBLIC_SET
bits in Modifiers.

RFC: https://wiki.php.net/rfc/asymmetric-visibility-v2

show more ...


# cde9bab3 01-Sep-2024 Nikita Popov

Add support for PHP 8.4 exit function

For backwards-compatibility, parse the simple single argument
case into an Exit_ node as previously. For more complex
expressions generate a fun

Add support for PHP 8.4 exit function

For backwards-compatibility, parse the simple single argument
case into an Exit_ node as previously. For more complex
expressions generate a function call.

show more ...


# 03caf4cc 14-Jul-2024 Nikita Popov

[8.4] Add support for property hooks

Add hooks subnode to Stmt\Property and Param, which contains an
array of PropertyHook.

The property hook support is considered experimental

[8.4] Add support for property hooks

Add hooks subnode to Stmt\Property and Param, which contains an
array of PropertyHook.

The property hook support is considered experimental and subject
to change.

RFC: https://wiki.php.net/rfc/property-hooks

show more ...


# 58de4791 21-Jul-2024 Nikita Popov

Remove error for abstract/final properties

These are allowed since PHP 8.4, with the introduction of property
hooks. (Abstract properties require hooks, which is not validated
here.)


# d8235a27 14-Jul-2024 Nikita Popov

[8.4] Add support for __PROPERTY__ magic constant

Part of property hooks RFC.


# 7b0384cd 25-May-2024 Nikita Popov

[8.4] Add support for new deref without parens

RFC: https://wiki.php.net/rfc/new_without_parentheses


# af14fdb2 21-Feb-2024 Nikita Popov

Avoid cyclic reference in parser

Pass $this as an explicit $self argument to the reduce callbacks,
so we can make them static. This avoids a circular reference in
the parser, so that

Avoid cyclic reference in parser

Pass $this as an explicit $self argument to the reduce callbacks,
so we can make them static. This avoids a circular reference in
the parser, so that it can be immediately destroyed when it goes
out of scope.

Fixes #980.

show more ...


# 8d50e9d0 03-Oct-2023 xjaja <5057757+xjaja@users.noreply.github.com>

Don't drop class statements before error (#952)

When encountering a null statement (indicating that an error occurred),
retain the preceding statements. These were accidentally dropped

Don't drop class statements before error (#952)

When encountering a null statement (indicating that an error occurred),
retain the preceding statements. These were accidentally dropped
previously.

(cherry picked from commit 54103d838734be0499172026525e38cbf6af2711)

show more ...


# b4183c2b 25-Sep-2023 Nikita Popov

Remove Stmt\Throw

This was a backwards-compatibility shim for Expr\Throw.


# a1ccf577 24-Sep-2023 Nikita Popov

Introduce Stmt\Block

Stmt\Block will be created for { $a; } style blocks, unless these
occur directly inside some structure that is usually combined
with a block.

For exampl

Introduce Stmt\Block

Stmt\Block will be created for { $a; } style blocks, unless these
occur directly inside some structure that is usually combined
with a block.

For example if ($a) { $b; } will continue to use the old
representation (plain array in in If_::$stmts), but a free-standing
{ $b; } will become a Stmt\Block.

Fixes #590.

show more ...


# f5adbb5e 24-Sep-2023 Nikita Popov

Add rawValue to InterpolatedStringPart and doc strings

For doc strings, the rawValue (on either the String_ or
InterpolatedStringPrts) does not include the leading indentation
(which

Add rawValue to InterpolatedStringPart and doc strings

For doc strings, the rawValue (on either the String_ or
InterpolatedStringPrts) does not include the leading indentation
(which is available as docIndentation) or the trailing newline on
the last part.

show more ...


# d8e80653 23-Sep-2023 Nikita Popov

Don't parse unicode escapes for PHP < 7.0

We still had the option for this but were hardcoding it to true.
Make it conditional on the PHP version instead.


# 502b0909 16-Aug-2023 Nikita Popov

Add property types

Types omitted in two places where we violate them currently:
Namespace_::$stmts can be null during parsing, and Enum_::$scalarType
can be a complex type for invali

Add property types

Types omitted in two places where we violate them currently:
Namespace_::$stmts can be null during parsing, and Enum_::$scalarType
can be a complex type for invalid programs.

show more ...


# 4b497045 29-Jul-2023 Nikita Popov

Move attribute handling into parser

The Lexer now only provides the tokens to the parser, while the
parser is responsible for determining which attributes are placed
on notes. This o

Move attribute handling into parser

The Lexer now only provides the tokens to the parser, while the
parser is responsible for determining which attributes are placed
on notes. This only needs to be done when the attributes are
actually needed, rather than for all tokens.

This removes the usedAttributes lexer option (and lexer options
entirely). The attributes are now enabled unconditionally. They
have less overhead now, and the need to explicitly enable them for
some use cases (e.g. formatting-preserving printing) doesn't seem
like a good tradeoff anymore.

There are some additional changes to the Lexer interface that
should be done after this, and the docs / upgrading guide haven't
been adjusted yet.

show more ...


# b20267c5 09-Jul-2023 Nikita Popov

Make use of default actions

For the default action $$ = $1, save the closure invocation.


# 91da1914 20-May-2023 Nikita Popov

Support readonly anonymous classes


# 5c267f55 20-May-2023 Nikita Popov

Add support for typed constants

RFC: https://wiki.php.net/rfc/typed_class_constants


# 6649012e 01-Mar-2023 Nikita Popov

Produce error if <?= used as identifier

Due to a peculiarity of how <?= is handled, it can get treated as
an echo identifier. Make sure it isn't, to match PHP behavior.


# cd3c0c11 26-Feb-2023 Nikita Popov

Remove __halt_compiler from semi reserved keyword list

Apparently PHP does not allow use of __halt_compiler as a
semi-reserved keyword.


# 2df8878f 29-Jan-2023 Nikita Popov

[PHP 8.3] Support dynamic class const fetch

RFC: https://wiki.php.net/rfc/dynamic_class_constant_fetch


# 0dd85ebd 18-Sep-2022 Nikita Popov

Support readonly before DNF type

This makes us match the PHP 8.2 handling of readonly. Handling of
"readonly" functions is moved to the parser to allow distinguishing
them from reado

Support readonly before DNF type

This makes us match the PHP 8.2 handling of readonly. Handling of
"readonly" functions is moved to the parser to allow distinguishing
them from readonly properties with DNF types. We have to uglify the
grammar to avoid some shift/reduce conflicts. Thank you WordPress.

show more ...


# 48f470ea 11-Sep-2022 Nikita Popov

Add missing return types


# 9b46dffb 11-Sep-2022 Nikita Popov

Fix formatting preservation for alternative elseif/else syntax

Test taken from PR #797.


1234567