History log of /PHP-8.2/Zend/zend_closures.c (Results 26 – 50 of 329)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# ab353a50 09-Jul-2021 Nikita Popov

Don't handle unnamed arg in closure debug info

Since PHP 8, we should no longer have any unnamed arguments.
Don't check for this case.

# 531413f8 25-May-2021 Joe Watkins

Merge branch 'PHP-8.0'

* PHP-8.0:
Fix #81076 Invalid implicit binds cause incorrect count in static vars of closure debug info


# 213063f6 24-May-2021 Joe Watkins

Fix #81076 Invalid implicit binds cause incorrect count in static vars of closure debug info

# 008bfcc7 14-May-2021 Nikita Popov

Use NO_DYNAMIC_PROPERTIES for Closure

Instead of manually implementing this, use the standard mechanism.
This has minor behavior changes (e.g. doing an isset() will now
return false

Use NO_DYNAMIC_PROPERTIES for Closure

Instead of manually implementing this, use the standard mechanism.
This has minor behavior changes (e.g. doing an isset() will now
return false instead of throwing) which are more in line with
typical behavior.

show more ...

# 559c3f6d 16-Apr-2021 twosee

Merge branch 'PHP-8.0'

* PHP-8.0:
Fixed bug #80929


# 09f55604 16-Apr-2021 twosee

Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
Fixed bug #80929


# c0b1bdcd 15-Apr-2021 twosee

Fixed bug #80929

The function name should be kept if Closure was created from the function which is marked as ZEND_ACC_CALL_VIA_TRAMPOLINE, because it is not a one-time thing and it may be c

Fixed bug #80929

The function name should be kept if Closure was created from the function which is marked as ZEND_ACC_CALL_VIA_TRAMPOLINE, because it is not a one-time thing and it may be called multiple times.

Closes GH-6867.

show more ...

# 47a2e5c7 18-May-2020 Nikita Popov

Reference dynamic functions through dynamic_defs

Currently, dynamically declared functions and closures are inserted
into the function table under a runtime definition key, and then late

Reference dynamic functions through dynamic_defs

Currently, dynamically declared functions and closures are inserted
into the function table under a runtime definition key, and then later
possibly renamed. When opcache is not used and a file containing a
closure is repeatedly included, this leads to a very large memory leak,
as the no longer needed closure declarations will never be freed
(https://bugs.php.net/bug.php?id=76982).

With this patch, dynamic functions are instead stored in a
dynamic_func_defs member on the op_array, which opcodes reference
by index. When the parent op_array is destroyed, the dynamic_func_defs
it contains are also destroyed (unless they are stilled used elsewhere,
e.g. because they have been bound, or are used by a live closure). This
resolves the fundamental part of the leak, though doesn't completely
fix it yet due to some arena allocations.

The main non-obvious change here is to static variable handling:
We can't destroy static_variables_ptr in destroy_op_array, as e.g.
that would clear the static variables in a dynamic function when
the op_array containing it is destroyed. Static variable destruction
is separated out for this reason (we already do static variable
destruction separately for normal functions, so we only need to
handle main scripts).

Closes GH-5595.

show more ...

# 5caf29a0 24-Feb-2021 Dmitry Stogov

Switch few functions useful in Symphony apps to new ZPP API.

# f37fe68e 20-Feb-2021 Nikita Popov

Fix closure GC handler for fake closures

Fixes oss-fuzz #31135.

# 59590663 20-Feb-2021 Dmitry Stogov

Fixed NULL pointer dereference

# 6b0f14fe 17-Feb-2021 Nikita Popov

Fixed bug #75474

For fake closures, we need to share static variables with the
original function, not work on a separate copy. Calling a function
through Closure::fromCallable() shou

Fixed bug #75474

For fake closures, we need to share static variables with the
original function, not work on a separate copy. Calling a function
through Closure::fromCallable() should have the same behavior as
calling it directly.

show more ...

# 6ce70447 12-Feb-2021 Máté Kocsis

Generate zend class entries based on stubs

Closes GH-6685

# 3e01f5af 15-Jan-2021 Nikita Popov

Replace zend_bool uses with bool

We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool

Replace zend_bool uses with bool

We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.

show more ...

# dfb9e033 02-Jan-2021 Tyson Andre

Use Z_PARAM_OBJ macros when zval isn't needed

In some cases, like spl_object_id, the code is simpler but equally efficient
after optimizations.

In other cases, like get_mangled_

Use Z_PARAM_OBJ macros when zval isn't needed

In some cases, like spl_object_id, the code is simpler but equally efficient
after optimizations.

In other cases, like get_mangled_object_vars(), the compiler can't infer that
the object in the zval won't change.

Closes GH-6567

show more ...

# c351768e 16-Nov-2020 Christoph M. Becker

Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
Fix #74558: Can't rebind closure returned by Closure::fromCallable()


# 78773890 12-Nov-2020 Christoph M. Becker

Fix #74558: Can't rebind closure returned by Closure::fromCallable()

Failure to rebind such closures is not necessarily related to them
being created by `ReflectionFunctionAbstract::getC

Fix #74558: Can't rebind closure returned by Closure::fromCallable()

Failure to rebind such closures is not necessarily related to them
being created by `ReflectionFunctionAbstract::getClosure()`, so we fix
the error message.

Closes GH-6424.

show more ...

# 8e0789a2 21-Sep-2020 Nikita Popov

Use proper parameter type in Closure::bindTo() signature

# b15885b5 19-Sep-2020 Máté Kocsis

Separate Closure::bind() implementations

Closure::bind() and Closure::bindTo() are currently reported as aliases in stubs because they have a single implementation. They are not aliases in f

Separate Closure::bind() implementations

Closure::bind() and Closure::bindTo() are currently reported as aliases in stubs because they have a single implementation. They are not aliases in fact though, they just use zend_parse_method_parameters() cleverly.

Thus, let's separate their implementation so that we don't have to alias Closure::bindTo() anymore. This will also have the advantage that the two ZPP implementations become more clear.

Closes GH-6169

show more ...

# fa8d9b11 28-Aug-2020 George Peter Banyard

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functio

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functions which return true/false (1/0)
Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics

Closes GH-6002

show more ...

# befe10fd 14-Aug-2020 Nikita Popov

Fix bug #78770

Refactor the zend_is_callable implementation to check callability
at a particular frame (this is an implementation detail for now,
but could be exposed in the API if u

Fix bug #78770

Refactor the zend_is_callable implementation to check callability
at a particular frame (this is an implementation detail for now,
but could be exposed in the API if useful). Pick the first parent
user frame as the one to check.

show more ...

# d92229d8 06-Apr-2020 Nikita Popov

Implement named parameters

From an engine perspective, named parameters mainly add three
concepts:

* The SEND_* opcodes now accept a CONST op2, which is the
argument nam

Implement named parameters

From an engine perspective, named parameters mainly add three
concepts:

* The SEND_* opcodes now accept a CONST op2, which is the
argument name. For now, it is looked up by linear scan and
runtime cached.
* This may leave UNDEF arguments on the stack. To avoid having
to deal with them in other places, a CHECK_UNDEF_ARGS opcode
is used to either replace them with defaults, or error.
* For variadic functions, EX(extra_named_params) are collected
and need to be freed based on ZEND_CALL_HAS_EXTRA_NAMED_PARAMS.

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

Closes GH-5357.

show more ...

# 8664ff7a 24-Jul-2020 Máté Kocsis

Cleanup argument handling in ext/reflection

Closes GH-5850

# d30cd7d7 26-May-2020 Máté Kocsis

Review the usage of apostrophes in error messages

Closes GH-5590

# 7da8c48a 07-Jul-2020 Nikita Popov

Merge branch 'PHP-7.4'

* PHP-7.4:
Fixed bug #79778


12345678910>>...14