History log of /php-src/ext/reflection/php_reflection.c (Results 1 – 25 of 1074)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 5070fbf1 26-Sep-2024 Máté Kocsis

Some tidying-up related to property existence checks


# 71edc051 17-Sep-2024 DanielEScherzer

php_reflection.c: make a bunch of pointers `const` (#15927)

* php_reflection.c: make a bunch of pointers `const`

* _function_closure_string: use %u for unsigned

Co-authored

php_reflection.c: make a bunch of pointers `const` (#15927)

* php_reflection.c: make a bunch of pointers `const`

* _function_closure_string: use %u for unsigned

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>

* _extension_class_string: make indent pointer `const`

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>

---------

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>

show more ...


# 65b4f226 16-Sep-2024 DanielEScherzer

Fix some misleading comments about `__clone()` never being executed (#15926)

For the `Exception`, `ReflectionClass`, and `ReflectionAttribute` classes, the
`__clone()` method is declared

Fix some misleading comments about `__clone()` never being executed (#15926)

For the `Exception`, `ReflectionClass`, and `ReflectionAttribute` classes, the
`__clone()` method is declared to be private, and the implementation has a
comment that it should never be executed. However, the implementation can be
executed by using a `ReflectionMethod`. Fix the comments to instead explain why
the implementation is needed.

[skip ci]

show more ...


# 2fce0bb8 16-Sep-2024 Ilija Tovilo

Implement ReflectionProperty::isFinal()

Closes GH-15919


# d75a289f 11-Sep-2024 Ilija Tovilo

Implement ReflectionProperty::hasHook[s]

Closes GH-15844


# 2ced1c92 11-Sep-2024 DanielEScherzer

Add `ReflectionProperty::isDynamic()` as an alternative to `isDefault()` (#15758)

Dynamic properties are generally referred to as "dynamic" properties, while
non-dynamic properties are n

Add `ReflectionProperty::isDynamic()` as an alternative to `isDefault()` (#15758)

Dynamic properties are generally referred to as "dynamic" properties, while
non-dynamic properties are not commonly referred to as "default" properties.
Thus, the existing method `ReflectionProperty::isDefault()` has a non obvious
name; while an alias could be added for `isNotDynamic()`, a new `isDynamic()`
method seems cleaner. The new method returns the opposite of `isDefault()`;
dynamic properties are not present on the class by default, and properties
present by default are not added dynamically.

Closes GH-15754

show more ...


# 18df69ee 03-Sep-2024 Daniel Scherzer

ReflectionProperty::get{Hook,Hooks}(): handle dynamic properties

For dynamic properties, instead of crashing with a segmentation fault, just say
that there are no hooks. Also includes a

ReflectionProperty::get{Hook,Hooks}(): handle dynamic properties

For dynamic properties, instead of crashing with a segmentation fault, just say
that there are no hooks. Also includes a test to prevent regression.

Fixes GH-15718
Closes GH-15721

show more ...


# 58aa6fc8 19-May-2023 Arnaud Le Blanc

Lazy objects

RFC: https://wiki.php.net/rfc/lazy-objects

Closes GH-15019


# 8df557ac 27-Aug-2024 Ilija Tovilo

[RFC] Asymmetric visibility v2 (GH-15063)

Co-authored-by: Larry Garfield <larry@garfieldtech.com>


# f78d5cfc 27-Jul-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Allow ZEND_ACC_VIRTUAL to be used to not have property backing storage without resorting to hooks

This is useful to reduce the memory usage of objects that don't actually
use the backing

Allow ZEND_ACC_VIRTUAL to be used to not have property backing storage without resorting to hooks

This is useful to reduce the memory usage of objects that don't actually
use the backing storage. Examples are XMLReader and DOM. When the
properties were added to the stubs, these objects became much much
bigger, which is a waste of memory.

Closes GH-11644.

Work towards GH-13988.

show more ...


# 780a8280 14-Jul-2024 Ilija Tovilo

[RFC] Property hooks (#13455)

RFC: https://wiki.php.net/rfc/property-hooks

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


# 11accb5c 25-Jun-2024 Arnaud Le Blanc

Preferably include from build dir (#13516)

* Include from build dir first

This fixes out of tree builds by ensuring that configure artifacts are included
from the build dir.

Preferably include from build dir (#13516)

* Include from build dir first

This fixes out of tree builds by ensuring that configure artifacts are included
from the build dir.

Before, out of tree builds would preferably include files from the src dir, as
the include path was defined as follows (ignoring includes from ext/ and sapi/) :

-I$(top_builddir)/main
-I$(top_srcdir)
-I$(top_builddir)/TSRM
-I$(top_builddir)/Zend
-I$(top_srcdir)/main
-I$(top_srcdir)/Zend
-I$(top_srcdir)/TSRM
-I$(top_builddir)/

As a result, an out of tree build would include configure artifacts such as
`main/php_config.h` from the src dir.

After this change, the include path is defined as follows:

-I$(top_builddir)/main
-I$(top_builddir)
-I$(top_srcdir)/main
-I$(top_srcdir)
-I$(top_builddir)/TSRM
-I$(top_builddir)/Zend
-I$(top_srcdir)/Zend
-I$(top_srcdir)/TSRM

* Fix extension include path for out of tree builds

* Include config.h with the brackets form

`#include "config.h"` searches in the directory containing the including-file
before any other include path. This can include the wrong config.h when building
out of tree and a config.h exists in the source tree.

Using `#include <config.h>` uses exclusively the include path, and gives
priority to the build dir.

show more ...


# 998bce11 07-Jun-2024 Ilija Tovilo

Show enum cases in errors

Closes GH-14496


# 8a872062 29-May-2024 Tim Düsterhus

reflection: Add `ReflectionGenerator::isClosed()` (#14358)

* reflection: Add `ReflectionGenerator::isClosed()`

see https://github.com/php/php-src/pull/14167#issuecomment-2133641998

reflection: Add `ReflectionGenerator::isClosed()` (#14358)

* reflection: Add `ReflectionGenerator::isClosed()`

see https://github.com/php/php-src/pull/14167#issuecomment-2133641998

* Fix test expectation

* Drop `{{{` / `}}}` comments around `ReflectionGenerator::isClosed()`

show more ...


# 8094bd1b 21-May-2024 Tim Düsterhus

Make `ReflectionGenerator::getFunction()` legal after generator termination (#14167)

* Make `ReflectionGenerator::getFunction()` legal after generator termination

* Expose the gener

Make `ReflectionGenerator::getFunction()` legal after generator termination (#14167)

* Make `ReflectionGenerator::getFunction()` legal after generator termination

* Expose the generator function name via `Generator::__debugInfo()`

* Allow creating `ReflectionGenerator` after termination

* Reorder `struct _zend_generator` to avoid a hole

* Adjust `ext/reflection/tests/028.phpt`

This is legal now.

* Fix Generator Closure collection

* Add test to verify the Closure dies with the generator

* NEWS / UPGRADING

show more ...


# c90c4fe5 14-May-2024 Tim Düsterhus

Add `zend_get_attribute_object()` (#14161)

* Add `zend_get_attribute_object()`

This makes the implementation for `ReflectionAttribute::newInstance()`
reusable.

* Add te

Add `zend_get_attribute_object()` (#14161)

* Add `zend_get_attribute_object()`

This makes the implementation for `ReflectionAttribute::newInstance()`
reusable.

* Add test for the stack trace behavior of ReflectionAttribute::newInstance()

This test ensures that the `filename` parameter for the fake stack frame is
functional. Without it, the stack trace would show `[internal function]` for
frame `#0`.

* Fix return type of `call_attribute_constructor`

show more ...


# f8d1864b 01-May-2024 Ilija Tovilo

Delay #[Attribute] arg validation until runtime

Fixes GH-13970
Closes GH-14105

We cannot validate at compile-time for multiple reasons:

* Evaluating the argument naivel

Delay #[Attribute] arg validation until runtime

Fixes GH-13970
Closes GH-14105

We cannot validate at compile-time for multiple reasons:

* Evaluating the argument naively with zend_get_attribute_value can lead to code
execution at compile time through the new expression, leading to possible
reentrance of the compiler.
* Even if the evaluation was possible, it would need to be restricted to the
current file, because constant values coming from other files can change
without affecting the current compilation unit. For this reason, validation
would need to be repeated at runtime anyway.
* Enums cannot be instantiated at compile-time (the actual bug report). This
could be allowed here, because the value is immediately destroyed. But given
the other issues, this won't be needed.

Instead, we just move it to runtime entirely. It's only needed for
ReflectionAttribute::newInstance(), which is not particularly a hot path. The
checks are also simple.

show more ...


# 6e8b1340 30-Apr-2024 Tim Düsterhus

reflection: Fix ReflectionFunction::getShortName() for first class callables (#14087)

Fix fixes an incorrect fix in php/php-src#14001.


# b5ffac7f 30-Apr-2024 Tim Düsterhus

Add ReflectionClassConstant::isDeprecated() (#14086)

This is in preparation for php/php-src#11293 and for consistency with
ReflectionConstant::isDeprecated() that was added in php/php-sr

Add ReflectionClassConstant::isDeprecated() (#14086)

This is in preparation for php/php-src#11293 and for consistency with
ReflectionConstant::isDeprecated() that was added in php/php-src#13669.

show more ...


# d03d4365 19-Apr-2024 Tim Düsterhus

reflection: Fix ReflectionFunction::getShortName() for Closures (#14001)

see php/php-src#13550


# e23440e5 11-Mar-2024 Ilija Tovilo

Implement reflection constant

Fixes GH-13570
Closes GH-13669


# 700fbca5 08-Mar-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Change getThis() into ZEND_THIS where possible (#13641)


# f2e199e8 25-Feb-2024 Máté Kocsis

Implement "support doc comments for internal classes and functions" (#13266)

Fixes #13130


# 4b405d85 25-Feb-2024 Máté Kocsis

Display class constant and property doc comments via reflection (#13499)


# 3b5986db 09-Dec-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Implement GH-12908: Show attribute name/class in ReflectionAttribute dump

This is consistent with how many other Reflection classes have a name
field, and it makes debugging easier.

Implement GH-12908: Show attribute name/class in ReflectionAttribute dump

This is consistent with how many other Reflection classes have a name
field, and it makes debugging easier.

Closes GH-12908.
Closes GH-12917.

show more ...


12345678910>>...43