| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fixed bug #78895 (Reflection detects abstract non-static class as abstract static. IS_IMPLICIT_ABSTRACT is not longer used)
|
| | |
| | |
| | |
| | | |
static. IS_IMPLICIT_ABSTRACT is not longer used)
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
According to RFC: https://wiki.php.net/rfc/union_types_v2
The type representation now makes use of both the pointer payload
and the type mask at the same time. Additionall, zend_type_list is
introduced as a new kind of pointer payload, which is used to store
multiple class types. Each of the class types is a tagged pointer,
which may be either a class name or class entry. The latter is only
used for typed properties, while arguments/returns will instead use
cache slots. A type list can contain a mix of both names and CEs at
the same time, as not all classes may be resolvable.
One thing this is missing is support for union types in arginfo
and stubs, which I want to handle separately.
I've also dropped the special object code from the JIT implementation
for now -- I plan to add this back in a different form at a later time.
For now I did not want to include non-trivial JIT changes together
with large functional changes.
Another possible piece of follow-up work is to implement "iterable"
as an internal alias for "array|Traversable". I believe this will
eliminate quite a few special-cases that had to be implemented.
Closes GH-4838.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We now store the pointer payload and the type mask separately. This
is in preparation for union types, where we will be using both at
the same time.
To avoid increasing the size of arginfo structures, the
pass_by_reference and is_variadic fields are now stored as part of
the type_mask (8-bit are reserved for custom use).
Different types of pointer payloads are distinguished based on bits
in the type_mask.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Public/protected properties defined in parent classes will be
inherited in the child -- there is no need to explicitly try to
walk up the chain and look them up.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Instead of constructing a dummy property_info for dynamic properties,
leave the field as NULL and handle this as appropriate.
This was originally part of an alternative fix for bug #78774, but
I think doing it this way is generally preferrable independently
of that.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fixed bug #78774
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The string held by the zend_type may be released if the property
type gets resolved to a CE. I initially wanted to fix this by
storing a zend_type* instead (so the property type resolution
propagates to the ReflectionType), but decided against this in
light of upcoming union types support, where we also need to
represent parts of the union, and will not have a single zend_type*
we can reference.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Since `zend_parse_parameters()` throws now, there is no reason to
explicitly call `zend_parse_parameters_throw()` anymore, and since both
have actually the same implementation, we redefine the latter as macro.
|
| | |
| | |
| | |
| | |
| | | |
We fix the trivial cases; some others need further discussion, see
<https://news-web.php.net/php.internals/107723>.
|
| | |
| | |
| | |
| | |
| | | |
This reverts commit ef439ec895a97a12e8f88c3371dfc8881a501649.
Test failures need to be resolved first.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add deprecated _ZendTestClass::__toString() method to preserve
an existing test.
ReflectionType::__toString() will now return a complete
representation of the type, as it should have originally. Users
that relied on nullability being absent should have been pushed
to ReflectionNamedType::getName() by the deprecation of
ReflectionType::__toString() in PHP 7.1 / PHP 7.4.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.4:
Fix bug #78697: inaccurate error message
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.3:
Fix bug #78697: inaccurate error message
|
| | |\
| | | |
| | | |
| | | |
| | | | |
* PHP-7.2:
Fix bug #78697: inaccurate error message
|
| | | | |
|
|\ \ \ \
| |/ / / |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* pack() only requires one argument
* stream_context_set_option() only requires two arguments
* ReflectionMethod::getClosure() accepts no args for static methods
* DOMDocument::createProcessingInstruction() only requires one arg
* DOMImplementation::createDocument() only requires two arguments
* DOMDocument::importNode() only requires one arg
* mysql_get_client_version() doesn't accept any args,
despite what the docs say...
|
| | | |
| | | |
| | | |
| | | | |
Closes GH-4732.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`get_closure` handlers are called to check whether an object is
callable, and to actually get the closure, respectively. The behavior
of the handler might differ for these two cases, particularly the
handler may throw in the latter case, but should not in the former.
Therefore we add a `check_only` parameter, to be able to distinguish
the desired purpose.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Instead of a simple if or 0 comparison. This would no longer work
if zend_type is a struct.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Use value 0 instead. To compensate we check in ReflectionParameter
allowsNull() whether the type is set at all: If it isn't, it always
allows null.
This removes a discrepancy between internal&userland functions:
For userland functions allowsNull() on untyped parameters returned
true, but for internal functions it returned false.
|
| | | |
| | | |
| | | |
| | | | |
Use ?T instead of "T or NULL".
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This switches zend_type from storing a single IS_* type code to
storing a MAY_BE_* type mask. Right now most code still assumes
that there is only a single type in the mask (or two together
with MAY_BE_NULL). But this will make it a lot simpler to introduce
union types.
An additional advantage (and why I'm doing this separately), is
that a number of special cases no longer need to be handled
separately: We can do a single mask & (1 << type) check to handle
all simple types, booleans (true|false) and null.
|
| | | |
| | | |
| | | |
| | | | |
This is never instantiated directly, only child classes are used.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This method only makes sense for single types, e.g. it would be
meaningless for union types.
Note that we always return ReflectionNamedType right now, so this does
not break compatibility for code using any currently existing types.
|
|\ \ \ \
| |/ / / |
|
| | | | |
|
|\ \ \ \
| |/ / / |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
New fix for bug #78263. This is special-cased elsewhere in the engine,
so we need to mirror it here.
|
| | | |
| | | |
| | | |
| | | | |
This reverts commit 428cfdd1810b17f0064b7691276f0eb92dc963b6.
|
|\ \ \ \
| |/ / / |
|
| | | |
| | | |
| | | |
| | | | |
And remove the Reflector::export() interface method.
|
|\ \ \ \
| |/ / /
| | | |
| | | |
| | | | |
* PHP-7.4:
Evaluate constant in class scope
|
| | | | |
|
|\ \ \ \
| |/ / / |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
export() methods were implemented in a roundabout way, where they
would call Reflection::export(), which would then call __toString().
Cut out the middleman by directly calling __toString().
|
|\ \ \ \
| |/ / / |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
And don't return null for rc=1 references. Leave it to the user
to decide whether or not they want to consider these as references
or not.
Fixes bug #78263.
|
| | | |
| | | |
| | | |
| | | | |
Closes GH-4247.
|
| | | |
| | | |
| | | |
| | | | |
Closes GH-4255.
|
|\ \ \ \
| |/ / /
| | | |
| | | |
| | | | |
* PHP-7.4:
Cheaper checks for exceptions thrown from __toString()
|
| | | | |
|
|\ \ \ \
| |/ / / |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|\ \ \ \
| |/ / /
| | | |
| | | |
| | | | |
* PHP-7.4:
Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros
|