History log of /PHP-8.2/Zend/zend_inheritance.c (Results 51 – 75 of 349)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 3eeeeeb1 02-Sep-2021 Nikita Popov

Fully qualify ReturnTypeWillChange in deprecation message

When adding the #[ReturnTypeWillChange] attribute in namespaced
code, you also need to use ReturnTypeWillChange, otherwise it

Fully qualify ReturnTypeWillChange in deprecation message

When adding the #[ReturnTypeWillChange] attribute in namespaced
code, you also need to use ReturnTypeWillChange, otherwise it
will be silently ignored and may result in confusion. Change the
deprecation message to suggest #[\ReturnTypeWillChange], which
will always work.

Closes GH-7454.

show more ...


# 6cc928c7 02-Sep-2021 Nikita Popov

Fully qualify ReturnTypeWillChange in deprecation message

When adding the #[ReturnTypeWillChange] attribute in namespaced
code, you also need to use ReturnTypeWillChange, otherwise it

Fully qualify ReturnTypeWillChange in deprecation message

When adding the #[ReturnTypeWillChange] attribute in namespaced
code, you also need to use ReturnTypeWillChange, otherwise it
will be silently ignored and may result in confusion. Change the
deprecation message to suggest #[\ReturnTypeWillChange], which
will always work.

Closes GH-7454.

show more ...


# 4bb66ddc 16-Aug-2021 Nikita Popov

Set EG(active)=0 during preloading shutdown

Just like during normal shutdown, we should set EG(active)=0
during the partial preloading shutdown, to make sure that no
user code can ru

Set EG(active)=0 during preloading shutdown

Just like during normal shutdown, we should set EG(active)=0
during the partial preloading shutdown, to make sure that no
user code can run.

We need to slightly tweak inheritance class loading to still
pick the right code path.

show more ...


# 1c6df2df 12-Aug-2021 Nikita Popov

Fixed bug #81192

Normally the filename is the current filename, but when traits
are involved, it might be a different one.


# 315f4094 11-Aug-2021 Nikita Popov

Always use CE_CACHE, remove TYPE_HAS_CE (#7336)

Currently, CE_CACHE on strings is only used with opcache interned strings. This
patch extends usage to non-opcache interned strings as wel

Always use CE_CACHE, remove TYPE_HAS_CE (#7336)

Currently, CE_CACHE on strings is only used with opcache interned strings. This
patch extends usage to non-opcache interned strings as well. This means that
most type strings can now make use of CE_CACHE even if opcache is not loaded,
which allows us to remove TYPE_HAS_CE kind, and fix some discrepancies
depending on whether a type stores a resolved or non-resolved name.

There are two cases where CE_CACHE will not be used:

* When opcache is not used and a permanent interned string (that is not an
internal class name) is used as a type name during the request. In this case
we can't allocate a map_ptr index for the permanent string, as it would be
not be in the permanent map_ptr index space.
* When opcache is used but the script is not cached (e.g. eval'd code or
opcache full). If opcache is used, we can't allocate additional map_ptr
indexes at runtime, because they may conflict with indexes allocated by
opcache.

In these two cases we would end up not using CE caching for property types
(argument/return types still have the separate cache slot).

show more ...


# 6e91a820 02-Aug-2021 Nikita Popov

Fix mutable data initialization during lazy class loading


# d836046a 29-Jul-2021 Nikita Popov

Perform preloading attempt on copied class

It is very hard to determine in advance whether class linking will
fail due to missing dependencies in variance checks (#7314 attempts
this

Perform preloading attempt on copied class

It is very hard to determine in advance whether class linking will
fail due to missing dependencies in variance checks (#7314 attempts
this). This patch takes an alternative approach where we try to
perform inheritance on a copy of the class (zend_lazy_class_load)
and then restore the original class if inheritance fails. The fatal
error in that case is recorded and thrown as a warning later.

Closes GH-7319.

show more ...


# b5746a4c 29-Jul-2021 Nikita Popov

Drop HAS_UNLINKED_USES flag

Instead always use the unlinked_uses table, which is already used
if opcache is used. Not much point in having a different mechanism
for the non-opcache c

Drop HAS_UNLINKED_USES flag

Instead always use the unlinked_uses table, which is already used
if opcache is used. Not much point in having a different mechanism
for the non-opcache case.

show more ...


# e0119525 28-Jul-2021 Nikita Popov

Preload unlinked classes, remove preload autoload (#7311)

Currently, classes that can't be linked get moved back into the original script
and are not preloaded. As such classes may be re

Preload unlinked classes, remove preload autoload (#7311)

Currently, classes that can't be linked get moved back into the original script
and are not preloaded. As such classes may be referenced from functions that
did get preloaded, there is a preload autoload mechanism to load them at
runtime.

Since PHP 8.1, we can safely preload unlinked classes, which will then go
through usual lazy loading. This means that we no longer need the preload
autoload mechanism. However, we need to be careful not to modify any hash
table buckets in-place, and should create new buckets for lazy loaded classes.

show more ...


# f78216f6 28-Jul-2021 Nikita Popov

Extract early binding registration code

This is the same for the cached and uncached cases and will make
GH-7311 a bit simpler.


# 56ef1174 27-Jul-2021 Nikita Popov

Remove special ctor handling in abstract class verification

This seems to be some kind of leftover from PHP 4 ctor support.


# 663536d7 27-Jul-2021 Máté Kocsis

Improve class inheritance error messages (#7307)


# 3eb97a45 22-Jul-2021 Nikita Popov

Always use separate static_members_table

When running without opcache, static_members_table is shared with
default_static_members_table. This is visible in reflection output,
because

Always use separate static_members_table

When running without opcache, static_members_table is shared with
default_static_members_table. This is visible in reflection output,
because ReflectionProperty::getDefaultValue() will return the
current value, rather than the default value.

Address this by never sharing the table, which matches the behavior
we already see under opcache.

Fixes bug #80821.

Closes GH-7299.

show more ...


# ae8647d9 20-Jul-2021 Levi Morrison

Remove leading underscore for _zend_hash_find_known_hash (#7260)

Convert zend_hash_find_ex(..., 1) to zend_hash_find_known_hash(...)
Convert zend_hash_find_ex(..., 0) to zend_hash_find(.

Remove leading underscore for _zend_hash_find_known_hash (#7260)

Convert zend_hash_find_ex(..., 1) to zend_hash_find_known_hash(...)
Convert zend_hash_find_ex(..., 0) to zend_hash_find(...)

Also add serializable changes to UPGRADING.INTERNALS summary

show more ...


# 6780aaa5 02-Jun-2021 Nikita Popov

Implement readonly properties

Add support for readonly properties, for which only a single
initializing assignment from the declaring scope is allowed.

RFC: https://wiki.php.net

Implement readonly properties

Add support for readonly properties, for which only a single
initializing assignment from the declaring scope is allowed.

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

Closes GH-7089.

show more ...


# 814a9327 16-Jul-2021 Nikita Popov

Add ZEND_ACC_NOT_SERIALIZABLE flag

This prevents serialization and unserialization of a class and its
children in a way that does not depend on the zend_class_serialize_deny
and zend

Add ZEND_ACC_NOT_SERIALIZABLE flag

This prevents serialization and unserialization of a class and its
children in a way that does not depend on the zend_class_serialize_deny
and zend_class_unserialize_deny handlers that will be going away
in PHP 9 together with the Serializable interface.

In stubs, `@not-serializable` can be used to set this flag.

This patch only uses the new flag for a handful of Zend classes,
converting the remainder is left for later.

Closes GH-7249.
Fixes bug #81111.

show more ...


# a837d353 19-Jul-2021 Nikita Popov

Don't track internal class dependencies

Subtyping relationships established on internal classes are always
going to hold (if we ignore Windows), so there is no need to
explicitly tra

Don't track internal class dependencies

Subtyping relationships established on internal classes are always
going to hold (if we ignore Windows), so there is no need to
explicitly track them.

This fixes an assertion failure in GH-7251.

show more ...


# 1bc5bd7f 15-Jul-2021 Nikita Popov

Handle both WARNING and UNRESOLVED during early binding

We would previously early exit on the WARNING, and miss the
later UNRESOLVED.


# a5360e80 06-Jul-2021 Máté Kocsis

Add support for final class constants

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

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


# 069a9fa5 05-Jul-2021 George Peter Banyard

Pure Intersection types (#6799)

Implement pure intersection types RFC

RFC: https://wiki.php.net/rfc/pure-intersection-types

Co-authored-by: Nikita Popov <nikic@php.net>

Pure Intersection types (#6799)

Implement pure intersection types RFC

RFC: https://wiki.php.net/rfc/pure-intersection-types

Co-authored-by: Nikita Popov <nikic@php.net>
Co-authored-by: Ilija Tovilo <ilutov@php.net>

show more ...


# ac99d5b5 01-Jul-2021 Nikita Popov

Simplify registration of unresolved classes

If we have an UNRESOLVED result, simply register all classes that
occur in either of the types. I believe that's equivalent to what
we're

Simplify registration of unresolved classes

If we have an UNRESOLVED result, simply register all classes that
occur in either of the types. I believe that's equivalent to what
we're currently doing in a more complicated way.

show more ...


# f256c3f6 30-Jun-2021 Nikita Popov

Move INHERITANCE_WARNING handling one layer up

There is only a single place where we need to convert ERROR into
WARNING, don't thread it through more places than necessary.


# 773e9ba5 28-Jun-2021 Máté Kocsis

Mention ReturnTypeWillChange attribute in the error message (#7183)


# ceb6fa6d 18-Jun-2021 Patrick Allaert

Convert some recently introduced zend_bool to bool

As well as `scripts/dev/check_parameters.php` utility.

Cfr. 3e01f5afb1b52fe26a956190296de0192eedeec1


# 100a1e8e 28-May-2021 Nikita Popov

Convert exception during inheritance to fatal error

Now that inheritance can throw deprecations again, these may be
converted to exception by a custom error handler. In this case
we

Convert exception during inheritance to fatal error

Now that inheritance can throw deprecations again, these may be
converted to exception by a custom error handler. In this case
we need to convert the exception to a fatal error, as inheritance
cannot safely throw in the general case.

show more ...


12345678910>>...14