| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
The YYERROR_VERBOSE macro will no longer be supported in Bison 3.6.
It was superseded by the "%error-verbose" directive in Bison 1.875
(2003-01-01). Bison 2.6 (2012-07-19) clearly announced that support
for YYERROR_VERBOSE would be removed. Note that since Bison 3.0
(2013-07-25), "%error-verbose" is deprecated in favor of "%define
parse.error verbose".
Closes GH-5125.
|
|
|
|
|
|
|
|
|
|
| |
Curly brace syntax for accessing array elements and string offsets is
deprecated [1]; this should also be the case for respective `new`
expressions.
This issue has been reported by brzuchal@php.net.
[1] <https://wiki.php.net/rfc/deprecate_curly_braces_array_access>
|
|
|
|
|
| |
As these do not operate on expressions, precedence is meaningless
for them.
|
|\ |
|
| |\ |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
RFC: https://wiki.php.net/rfc/deprecate_curly_braces_array_access
|
| | |
| | |
| | |
| | |
| | | |
Avoid having holes in the token stream which are annoying and
inefficient to reconstruct on the consumer side.
|
| | |
| | |
| | |
| | | |
ZEND_ASSGIN_OBJ_OP and ZEND_ASSIGN_STATIC_PROP_OP
|
| | |
| | |
| | |
| | |
| | | |
%pure-parser is deprecated. In our case there is no difference between
true & full, as we don't use locations.
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | | |
Implementing RFC https://wiki.php.net/rfc/concatenation_precedence
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
RFC: https://wiki.php.net/rfc/spread_operator_for_array
Closes GH-3640.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Deprecate nesting ternary operators without explicit parentheses.
RFC: https://wiki.php.net/rfc/ternary_associativity
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | | |
Per RFC: https://wiki.php.net/rfc/arrow_functions_v2
Co-authored-by: Levi Morrison <levim@php.net>
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit e528762c1c59bc0bd0bd6d78246c14269630cf0f.
Dmitry reports that this has a non-trivial impact on parsing
overhead, especially on 32-bit systems. As we don't have a strong
need for this change right now, I'm reverting it.
See also comments on
https://github.com/php/php-src/commit/e528762c1c59bc0bd0bd6d78246c14269630cf0f.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Locations for AST nodes are now tracked with the help of bison
location tracking. This is more accurate than what we currently do
and easier to extend with more information.
A zend_ast_loc structure is introduced, which is used for the location
stack. Currently it only holds the start lineno, but can be extended
to also hold end lineno and offset/column information in the future.
All AST constructors now accept a zend_ast_loc* as first argument, and
will use it to determine their lineno. Previously this used either the
CG(zend_lineno), or the smallest AST lineno of child nodes.
On the parser side, the location structure for a whole rule can be
obtained using the &@$ character salad.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Some of these are entirely unnecessary. Some specify an associativity
for operators where the concept doesn't make sense and has no effect:
Explicit associativity is only meaningful for binary operators. For
unary operators and constrained operations like instanceof or assignment
the associativity specification has no effect and only serves to confuse.
For example assignments were specified as %left, even though they will
actually behave as right-associative due to the variable requirement on
the LHS. Similarly instanceof was specified as %nonassoc, but it will
behave as left-associative, due to the restrictions places on the RHS.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.
A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.
This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.
With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.
Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files. All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
RFC: https://wiki.php.net/rfc/null_coalesce_equal_operator
$a ??= $b is $a ?? ($a = $b), with the difference that $a is only
evaluated once, to the degree that this is possible. In particular
in $a[foo()] ?? $b function foo() is only ever called once.
However, the variable access themselves will be reevaluated.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
RFC: https://wiki.php.net/rfc/typed_properties_v2
This is a squash of PR #3734, which is a squash of PR #3313.
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Instead of representing this as a ZEND_AST_CLASS_CONST with a
"class" constant name.
Class constants and ::class are unrelated features that happen to
share syntax, so represent and handle them separately.
|
|/ / |
|
| |
| |
| |
| | |
Encode static variable offset into opline->extended_value.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.
In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.
This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
|
| |
| |
| |
| | |
We no longer need this distinction.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I've introduced a new CompileError type, from which ParseError
inherits. These errors are not parse errors in the narrow sense
of the term, even though they happen to be generated during
parsing in our implementation. Additionally reusing the ParseError
class for this purpose would change existing error messages (if
the exception is not caught) from a "Fatal error:" to a "Parse
error:" prefix, and also the error kind from E_COMPILE_ERROR to
E_PARSE.
|
| |
| |
| |
| | |
where we sure about string persistence.
|
| | |
|
| |
| |
| |
| |
| |
| | |
ext/tokenizer) and cheaper whitespace handlig."
This reverts commit 0d6da03f5c3e49b92cf6817ba8a7f8d6f60ee1aa.
|
| |
| |
| |
| | |
cheaper whitespace handlig.
|
| | |
|
|/ |
|
| |
|
|
|
|
| |
RFC: https://wiki.php.net/rfc/list-syntax-trailing-commas
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hereby, interned strings are supported in thread safe PHP. The patch
implements two types of interned strings
- interning per process, strings are not freed till process end
- interning per request, strings are freed at request end
There is no runtime interning.
With Opcache, all the permanent iterned strings are copied into SHM on
startup, additional copying into SHM might happen on demand.
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
T_NUM_STRING follows the rules of symtable numeric string
conversion. If the offset isn't an integer under those rules, it
is treated as a string. This should apply to negated T_NUM_STRINGs
as well.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| | |
We allow negative numeric offsets for the simple syntax inside
double-quoted and heredoc strings.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the following issues:
* "use function" and "use const" inside namespaced code were checking
for conflicts against class imports. Now they always check against
the correct symbol type.
* Symbol conflicts are now always checked within a single file only.
Previously class uses inside namespaced code were checked globally.
This behavior is illegal because symbols from other files are not
visible if opcache is used, resulting in behavioral discrepancies.
Additionally this made the presence/absence of symbol errors dependent
on autoloading order, which is volatile.
* The "single file" restriction is now enforced by collecting defined
symbols inside a separate hash table. Previously it was enforced
(for the non-namespaced case) by comparing the filename of the
symbol declaration. However this is inaccurate if the same filename
is used multiple times, such as may happen if eval() is used.
* Additionally the previous approach relies on symbols being registered
at compile-time, which is not the case for late-bound classes, which
makes the behavior dependent on class declaration order, as well as
opcache (which may cause delayed early-binding).
* Lastly, conflicts are now consistently checked for conditionally
defined symbols. Previously only declaration-after-use conflicts were
checked in this case. Now use-after-declaration conflicts are
detected as well.
|
| |
|
|
|
|
| |
Previously array() was only forbidden on the outermost level.
|
| |
|
| |
|
| |
|