[pull] master from php:master - #1127
Merged
Merged
Conversation
Move init_curl_handle() so that memory is not leaked if curl_easy_duphandle() fails within curl_clone_obj(). init_curl_handle() allocates state that curl_free_obj() later frees, but curl_free_obj() does nothing if ch->cp is not set. In curl_clone_obj(), defer that allocation until a valid copied handle exists so failed duplication leaves nothing to clean up. Closes #22899
* PHP-8.4: ext/curl: fix mem leak when duphandle fails in curl_clone_obj (#22899)
* PHP-8.5: ext/curl: fix mem leak when duphandle fails in curl_clone_obj (#22899)
* Use a pointer to the declaring opline->lineno as unique addr, instead of the declaring opline itself zend_partial_create() takes a 'zend_op* declaring_opline' parameter for the purpose of building a cache key: the opline address is unique to this PFA as long as it's in SHM. However the declaring opline is not available when evaluating a PFA AST. Replace the parameter by 'uint32_t* declaring_lineno'. Callers can pass '&zend_op->lineno' or '&ast->lineno': Both are unique to the related PFA. * zend_partial_create(): Remove the dependency on the declaring op_array The declaring op_array is used for multiple purposes: * Generating a PFA name * Finding the filename * Finding whether op_array is cached, and therefore whether the PFA should be cached too However it's not available when evaluating a PFA AST. Remove the declaring_op_array argument, and pass the relevant information directly: * Generate the PFA name at compile time, pass it as argument to zend_partial_create() * Pass the filename and a cacheable flag as argument to zend_partial_create() * Support for PFA in constant expressions
* PHP-8.4: Forbid \C in UTF-8 patterns (#21139)
This reject NUL byte in the setlocale() function in the standard extension.
* PHP-8.5: Forbid \C in UTF-8 patterns (#21139)
Pre-bound arguments are bound to the generated closure's lexical vars:
```
function f($a, $b) {}
$f = f(1, ?);
// Generates:
$tmp = 1;
$f = function ($b) use ($tmp) {
return f($tmp, $b);
};
```
Detect which pre-bound arguments are constant and burn them into the generated
closure instead:
```
function f($a, $b) {}
$f = f(1, ?);
// Generates:
$f = function ($b) {
return f(1, $b);
};
```
It's not exported in a header and only used in the file it is defined
Add tests for the four error cases in `reflection_property_check_lazy_compatible()`, as triggered by both `ReflectionProperty::setRawValueWithoutLazyInitialization()` and `ReflectionProperty::skipLazyInitialization()`. While some of these errors are covered by existing tests, having all of the errors in one place will make it easier to see the changes when the error messages are improved.
Improve error messages from `reflection_property_check_lazy_compatible()`, as triggered by both `ReflectionProperty::setRawValueWithoutLazyInitialization()` and `ReflectionProperty::skipLazyInitialization()`. Say "cannot" instead of "can not", and include parentheses after the method name.
…error Align with other Reflection exceptions for missing class properties (and methods, constants, etc.) by changing the message to "Property %s::$%s does not exist".
The value is a uint32_t and this may depend on the platform how it is represented
Also make private as these are not used outside of the file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )