| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| |
|
|
| |
Don't generate try {} blocks for the operations that don't throw.
|
| |\ |
|
| | |\ |
|
| | | |
| | |
| | |
| | | |
Closes GH-4324.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Also adds an --asan flag to run-tests.php to setup all the necessary
environment variables. Some tests are marked as skipped because they
are incompatible with asan or too slow.
I'm basing this on the DEBUG_ZTS build, which seems to give us the
most mileage.
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | | |
RFC: https://wiki.php.net/rfc/numeric_literal_separator
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Keep track of delayed variance obligations and check them after
linking a class is otherwise finished. Obligations may either be
unresolved method compatibility (because the necessecary classes
aren't available yet) or open parent/interface dependencies. The
latter occur because we allow the use of not fully linked classes
as parents/interfaces now.
An important aspect of the implementation is we do not require
classes involved in variance checks to be fully linked in order for
the class to be fully linked. Because the involved types do have to
exist in the class table (as partially linked classes) and we do
check these for correct variance, we have the guarantee that either
those classes will successfully link lateron or generate an error,
but there is no way to actually use them until that point and as
such no possibility of violating the variance contract. This is
important because it ensures that a class declaration always either
errors or will produce an immediately usable class afterwards --
there are no cases where the finalization of the class declaration
has to be delayed until a later time, as earlier variants of this
patch did.
Because variance checks deal with classes in various stages of
linking, we need to use a special instanceof implementation that
supports this, and also introduce finer-grained flags that tell us
which parts have been linked already and which haven't.
Class autoloading for variance checks is delayed into a separate
stage after the class is otherwise linked and before delayed
variance obligations are processed. This separation is needed to
handle cases like A extends B extends C, where B is the autoload
root, but C is required to check variance. This could end up
loading C while the class structure of B is in an inconsistent
state.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
We weren't able to do this in 7.1 because the deprecation notice
may be converted to an exception and __toString() can't throw,
which means that it ultimately become a fatal error. This issue
is resolved now, so we can mark the method as deprecated.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
RFC: https://wiki.php.net/rfc/tostring_exceptions
And convert some object to string conversion related recoverable
fatal errors into Error exceptions.
Improve exception safety of internal code performing string
conversions.
|
| | | |
| | |
| | |
| | | |
This reverts commit 050d299364ded5cb7b878bc515aa763c9c623c4b.
|
| | | |
| | |
| | |
| | | |
This deprecation is part of the covariance RFC.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is a minimal variance implementation: It does not support any
cyclic type dependencies. Additionally the preloading requirements
are much more restrictive than necessary. Hopefully we can relax
these in the future.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Fixes bug #76451, and more importantly lays necessary groundwork for
covariant/contravariant types. Bug #76451 is just an edge case, but
once covariance is introduced this will become a common problem instead.
|
| | | | |
|
| | | |
| | |
| | |
| | | |
This reverts commit 969047749d33bb88a0573aa91a57e2070335111a.
|
| | | |
| | |
| | |
| | |
| | | |
This syncs PHP lexer files to all use *.re extension. The *.re files are
processed with the RE2C tool.
|
| |\ \ \
| |/ / |
|
| | |\ \
| | |/ |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If we perform a class fetch that is not marked as exception safe,
convert exceptions thrown by autoloaders into a fatal error.
Ideally fetching the interfaces would be exception safe, but as it
isn't right now, we must abort at this point.
|
| | | | |
|
| |\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.3:
Fix test case
|
| | |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.2:
Fix test case
|
| | | |
| | |
| | |
| | |
| | | |
stderr is supposed to be redirected to NUL (which is roughly equivalent
to /dev/null on POSIX), but actually was redirected to a file.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | | |
RFC: https://wiki.php.net/rfc/spread_operator_for_array
Closes GH-3640.
|
| |\ \ \
| |/ / |
|
| | |\ \
| | |/ |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If a PHP file contains an invalid hex literal such as `0x_10`, the expected error
is `Parse error: syntax error, unexpected 'x_10' (T_STRING) in %s on line %d`.
This already worked correctly on Linux, but on Windows prior to this patch a different
error was produced: `Parse error: Invalid numeric literal in %s on line %d`.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Make sure to always fetch the RHS of a list assignment first, instead
of special casing known self-assignments, which will not detect cases
using references correctly.
As a side-effect, it is no longer possible to do something like
byRef(list($x) = $y). This worked by accident previously, but only
if $y was a CV and the self-assignment case did not trigger.
However it shouldn't work for the same reason that byRef($x = $y)
doesn't. Conversely byRef(list(&$x) = $y) and byRef($x =& $y)
continue to be legal.
|
| |\ \ \
| |/ / |
|
| | |\ \
| | |/ |
|
| | | |
| | |
| | |
| | |
| | | |
We can't assume that the method we're checking against is part of
the parent class...
|
| | | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
By introducing a hook that is called whenever one of
internal_encoding / input_encoding / output_encoding changes, so
that mbstring can adjust it's internal state.
This also makes internal_encoding work with zend multibyte.
|
| |\ \ \
| |/ / |
|
| | | |
| | |
| | |
| | |
| | |
| | | |
When a HT iterator is one past the end and we rehash, we need to make
sure that it is move to the new one past the end position, to make
sure that newly inserted elements are picked up.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | | |
See https://github.com/php/php-src/pull/3993 for context.
|