History log of /PHP-8.0/Zend/zend_language_scanner.l (Results 1 – 25 of 474)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 118ff033 16-Dec-2020 Nikita Popov

Fix bug #80523

Don't truncate the file length to unsigned int...

I have no idea whether that fully fixes the problem because the
process gets OOM killed before finishing, but at

Fix bug #80523

Don't truncate the file length to unsigned int...

I have no idea whether that fully fixes the problem because the
process gets OOM killed before finishing, but at least the
immediate parse error is gone now.

show more ...


# 7a61984a 02-Dec-2020 Nikita Popov

Fixed bug #80462


Revision tags: php-8.0.0, php-7.3.25, php-7.4.13, php-8.0.0RC5, php-7.4.13RC1, php-8.0.0RC4, php-7.3.25RC1, php-7.4.12, php-8.0.0RC3, php-7.3.24, php-8.0.0RC2, php-7.4.12RC1, php-7.3.24RC1, php-7.2.34, php-8.0.0rc1, php-7.4.11, php-7.3.23, php-8.0.0beta4, php-7.4.11RC1, php-7.3.23RC1
# f5dbebd8 07-Sep-2020 Nikita Popov

Accept zend_string instead of zval in zend_compile_string


# e8d36ce7 04-Sep-2020 Nikita Popov

Avoid duplicate octal warning during heredoc scan ahead


# 7620ea15 03-Sep-2020 Nikita Popov

Don't intern compiled_filename

For php-ast interning the file name is an effective memory leak,
see php-ast#134.

I don't think there's any reason to do this. At some point this

Don't intern compiled_filename

For php-ast interning the file name is an effective memory leak,
see php-ast#134.

I don't think there's any reason to do this. At some point this
was needed due to bugs in the interned string mechanism that
caused issues if the string was later interned, e.g. through a
__FILE__ reference. These issues have since been resolved.

In conjunction with the filenames_table removal in c4016ecd446ef26bb3dc77735b6e441e151ea985
this means that filenames now need to be refcounted like normal
strings. In particular the filename reference in op_arrays and CEs
are refcounted.

show more ...


Revision tags: php-8.0.0beta3, php-7.4.10, php-7.3.22, php-8.0.0beta2, php-7.3.22RC1, php-7.4.10RC1
# 8b37c1e9 15-Aug-2020 Benjamin Eberlei

Change Attribute Syntax from @@ to #[]


# fa8d9b11 28-Aug-2020 George Peter Banyard

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functio

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functions which return true/false (1/0)
Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics

Closes GH-6002

show more ...


# 1b2ec73c 26-Aug-2020 George Peter Banyard

Drop various unused macros/APIs

Also convert_libmagic_pattern() to return a zend_string*

Closes GH-6029


# 10f660f0 09-Aug-2020 Ilija Tovilo

Fix ?-> in encaps vars without braces

Closes GH-5966.


# c439f1fa 10-Aug-2020 Nikita Popov

Fixed bug #62294

The primary issue was already resolved in 7c3e487289ec41e560cf7a77e36eb43da2234f33,
but the particular example used in this bug report ran into an
additional issue o

Fixed bug #62294

The primary issue was already resolved in 7c3e487289ec41e560cf7a77e36eb43da2234f33,
but the particular example used in this bug report ran into an
additional issue on PHP 8, because I forgot to drop a number of
zend_bailout calls when switch require failure to throw.

show more ...


# 896dad4c 10-Aug-2020 Nikita Popov

Fixed bug #77561

Unconditionally strip shebang lines when using the CLI SAPI,
independently of whether they occur in the primary or non-primary
script. It's unlikely that someone int

Fixed bug #77561

Unconditionally strip shebang lines when using the CLI SAPI,
independently of whether they occur in the primary or non-primary
script. It's unlikely that someone intentionally wants to print
that shebang line when including a script, and this regularly
causes issues when scripts are used in multiple contexts, e.g.
for direct invocation and as a phar bootstrap.

show more ...


# 06ade155 05-Aug-2020 Pieter van den Ham

Fix #79934: CRLF-only line in heredoc causes parsing error

Fixes the function `next_newline()` in zend_language_scanner.l. The
function now correctly returns a newline_len of 2 for "\r\n

Fix #79934: CRLF-only line in heredoc causes parsing error

Fixes the function `next_newline()` in zend_language_scanner.l. The
function now correctly returns a newline_len of 2 for "\r\n".

Closes GH-5944.

show more ...


Revision tags: php-8.0.0beta1, php-7.4.9, php-7.2.33, php-7.3.21, php-8.0.0alpha3, php-7.4.9RC1, php-7.3.21RC1, php-7.4.8, php-7.2.32, php-8.0.0alpha2, php-7.3.20
# 470d1696 02-Jul-2020 Theodore Brown

Implement Shorter Attribute Syntax

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

Closes GH-5796.

Co-authored-by: Martin Schröder <m.schroeder2007@gmail.com>


Revision tags: php-8.0.0alpha1, php-7.4.8RC1, php-7.3.20RC1, php-7.4.7, php-7.3.19, php-7.4.7RC1, php-7.3.19RC1
# 9bf11983 24-May-2020 Ilija Tovilo

Implement nullsafe ?-> operator

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

Closes GH-5619.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>


# 7a3dcc3e 15-Jun-2020 Nikita Popov

Treat namespaced names as single token

Namespace names are now lexed as single tokens of type
T_NAME_QUALIFIED, T_NAME_FULLY_QUALIFIED or T_NAME_RELATIVE.

RFC: https://wiki.php.

Treat namespaced names as single token

Namespace names are now lexed as single tokens of type
T_NAME_QUALIFIED, T_NAME_FULLY_QUALIFIED or T_NAME_RELATIVE.

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

Closes GH-5827.

show more ...


Revision tags: php-7.4.6, php-7.2.31, php-7.4.6RC1, php-7.3.18RC1, php-7.2.30, php-7.4.5, php-7.3.17
# 9fa1d133 09-Apr-2020 Ilija Tovilo

Implement match expression

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

Closes GH-5371.


Revision tags: php-7.4.5RC1, php-7.3.17RC1, php-7.3.18, php-7.4.4, php-7.2.29, php-7.3.16, php-7.4.4RC1, php-7.3.16RC1, php-7.4.3, php-7.2.28
# 47cf18ba 15-Feb-2020 Nikita Popov

Don't include trailing newline in comment token

Don't include a trailing newline in T_COMMENT tokens, instead leave
it for a following T_WHITESPACE token. The newline does not belong

Don't include trailing newline in comment token

Don't include a trailing newline in T_COMMENT tokens, instead leave
it for a following T_WHITESPACE token. The newline does not belong
to the comment logically, and this makes for an ugly special case,
as other tokens do not include trailing newlines.

Whitespace-sensitive tooling will want to either forward or backward
emulate this change.

Closes GH-5182.

show more ...


# 55717656 19-Jun-2020 Nikita Popov

Forbid use of <?= as a semi-reserved identifier

One of the weirdest pieces of PHP code I've ever seen. In terms
of tokens, this gets internally translated to

use x as y; ech

Forbid use of <?= as a semi-reserved identifier

One of the weirdest pieces of PHP code I've ever seen. In terms
of tokens, this gets internally translated to

use x as y; echo as my_echo;

On master it crashes because this "echo" does not have attached
identifier metadata. Make sure it is added and then reject the
use of "<?=" as an identifier inside zend_lex_tstring.

Fixes oss-fuzz #23547.

show more ...


# c7ad8a87 12-Jun-2020 Nikita Popov

Initialize indentation_uses_spaces field

This avoids reading a trap representation from _Bool,
but shouldn't matter as far as behavior is concerned.


# b03cafd1 05-Jun-2020 Nikita Popov

Fix bug #77966: Cannot alias a method named "namespace"

This is a bit tricky: In this cases we have "namespace as", which
means that we will only recognize "namespace" as an identifier w

Fix bug #77966: Cannot alias a method named "namespace"

This is a bit tricky: In this cases we have "namespace as", which
means that we will only recognize "namespace" as an identifier when
the lookahead token is already at the "as". This means that
zend_lex_tstring picks up the wrong identifier.

We solve this by actually assigning the identifier as the semantic
value on the parser stack -- as in almost all cases we will not
actually need the identifier, this is just an (offset, size)
reference, not a copy of the string.

Additionally, we need to teach the lexer feedback mechanism used
by tokenizer TOKEN_PARSE mode to apply feedback to something
other than the very last token. To that purpose we pass through
the token text and check the tokens in reverse order to find the
right one.

Closes GH-5668.

show more ...


# 80598f12 08-Apr-2020 Alex Dowad

Syntax errors caused by unclosed {, [, ( mention specific location

Aside from a few very specific syntax errors for which detailed exceptions are
thrown, generally PHP just emits the def

Syntax errors caused by unclosed {, [, ( mention specific location

Aside from a few very specific syntax errors for which detailed exceptions are
thrown, generally PHP just emits the default error messages generated by bison on syntax
error. These messages are very uninformative; they just say "Unexpected ... at line ...".

This is most problematic with constructs which can span an arbitrary number of lines, such
as blocks of code delimited by { }, 'if' conditions delimited by ( ), and so on. If a closing
delimiter is missed, the block will run for the entire remainder of the source file (which
could be thousands of lines), and then at the end, a parse error will be thrown with the
dreaded words: "Unexpected end of file".

Therefore, track the positions of opening and closing delimiters and ensure that they match
up correctly. If any mismatch or missing delimiter is detected, immediately throw a parse
error which points the user to the offending line. This is best done in the *lexer* and not
in the parser.

Thanks to Nikita Popov and George Peter Banyard for suggesting improvements.

Fixes bug #79368.
Closes GH-5364.

show more ...


# 3709e74b 06-Apr-2020 Máté Kocsis

Store default parameter values of internal functions in arg info

Closes GH-5353. From now on, PHP will have reflection information
about default values of parameters of internal function

Store default parameter values of internal functions in arg info

Closes GH-5353. From now on, PHP will have reflection information
about default values of parameters of internal functions.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>

show more ...


# 4565a7f2 16-Mar-2020 Nikita Popov

Fix assertion when (real) is used

And bring back a test for it...


# c9db3227 28-Feb-2020 George Peter Banyard

Remove deprecated (real) cast

Closes GH-5220


# 6c48da9a 28-Feb-2020 Nikita Popov

Fixed bug #79062

Back up the doc comment when performing heredoc scanahead.


12345678910>>...19