Skip to content

Commit 197f4a3

Browse files
committed
Merge remote-tracking branch 'origin/master' into asan_zend_alloc
2 parents 3c111a7 + 2e2494f commit 197f4a3

22 files changed

+678
-73
lines changed

NEWS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ PHP NEWS
148148
has a wrong return type. (David Carlier)
149149
. Added Pdo_Sqlite::ATTR_BUSY_STATEMENT constant to check
150150
if a statement is currently executing. (David Carlier)
151+
. Added Pdo_Sqlite::ATTR_EXPLAIN_STATEMENT constant to set a statement
152+
in either EXPLAIN_MODE_PREPARED, EXPLAIN_MODE_EXPLAIN,
153+
EXPLAIN_MODE_EXPLAIN_QUERY_PLAN modes. (David Carlier)
151154

152155
- PGSQL:
153156
. Added pg_close_stmt to close a prepared statement while allowing
@@ -237,12 +240,18 @@ PHP NEWS
237240
. Fix overall theorical overflows on zend_string buffer allocations.
238241
(David Carlier/nielsdos)
239242

243+
- Sqlite:
244+
. Added Sqlite3Stmt::busy to check if a statement is still being executed.
245+
(David Carlier)
246+
240247
- Standard:
241248
. Fixed crypt() tests on musl when using --with-external-libcrypt
242249
(Michael Orlitzky).
243250
. Fixed bug GH-18062 (is_callable(func(...), callable_name: $name) for first
244251
class callables returns wrong name). (timwolla)
245252
. Added array_first() and array_last(). (nielsdos)
253+
. Fixed bug GH-18823 (setlocale's 2nd and 3rd argument ignores strict_types).
254+
(nielsdos)
246255

247256
- Streams:
248257
. Fixed bug GH-16889 (stream_select() timeout useless for pipes on Windows).

UPGRADING

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ PHP 8.5 UPGRADE NOTES
198198

199199
- PDO_Sqlite:
200200
. Added class constant Pdo_Sqlite::ATTR_BUSY_STATEMENT.
201+
. Added class constants Pdo_Sqlite::ATTR_EXPLAIN_STATEMENT,
202+
Pdo_Sqlite::EXPLAIN_MODE_PREPARED, Pdo_Sqlite::EXPLAIN_MODE_EXPLAIN,
203+
Pdo_Sqlite::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN.
201204

202205
- SOAP:
203206
. Enumeration cases are now dumped in __getTypes().
@@ -390,6 +393,10 @@ PHP 8.5 UPGRADE NOTES
390393
. ReflectionConstant::getAttributes() was introduced.
391394
RFC: https://wiki.php.net/rfc/attributes-on-constants
392395

396+
- Sqlite:
397+
. Sqlite3Stmt::busy to check if a statement had been fetched
398+
but not completely.
399+
393400
- Standard:
394401
. Added array_first() and array_last().
395402
RFC: https://wiki.php.net/rfc/array_first_last

Zend/zend_operators.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,7 @@ ZEND_API zend_result ZEND_FASTCALL concat_function(zval *result, zval *op1, zval
20242024
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_CONCAT);
20252025
op2_string = zval_try_get_string_func(op2);
20262026
if (UNEXPECTED(!op2_string)) {
2027-
zend_string_release(op1_string);
2027+
zend_string_release_ex(op1_string, false);
20282028
if (orig_op1 != result) {
20292029
ZVAL_UNDEF(result);
20302030
}
@@ -2069,8 +2069,8 @@ has_op2_string:;
20692069
uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES_BOTH(op1_string, op2_string);
20702070

20712071
if (UNEXPECTED(op1_len > ZSTR_MAX_LEN - op2_len)) {
2072-
if (free_op1_string) zend_string_release(op1_string);
2073-
if (free_op2_string) zend_string_release(op2_string);
2072+
if (free_op1_string) zend_string_release_ex(op1_string, false);
2073+
if (free_op2_string) zend_string_release_ex(op2_string, false);
20742074
zend_throw_error(NULL, "String size overflow");
20752075
if (orig_op1 != result) {
20762076
ZVAL_UNDEF(result);
@@ -2093,7 +2093,7 @@ has_op2_string:;
20932093
/* account for the case where result_str == op1_string == op2_string and the realloc is done */
20942094
if (op1_string == op2_string) {
20952095
if (free_op2_string) {
2096-
zend_string_release(op2_string);
2096+
zend_string_release_ex(op2_string, false);
20972097
free_op2_string = false;
20982098
}
20992099
op2_string = result_str;
@@ -2112,8 +2112,8 @@ has_op2_string:;
21122112
ZSTR_VAL(result_str)[result_len] = '\0';
21132113
}
21142114

2115-
if (free_op1_string) zend_string_release(op1_string);
2116-
if (free_op2_string) zend_string_release(op2_string);
2115+
if (free_op1_string) zend_string_release_ex(op1_string, false);
2116+
if (free_op2_string) zend_string_release_ex(op2_string, false);
21172117

21182118
return SUCCESS;
21192119
}

ext/curl/share.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ PHP_FUNCTION(curl_share_init_persistent)
160160
}
161161

162162
ZEND_HASH_FOREACH_VAL(share_opts, zval *entry) {
163-
ZVAL_DEREF(entry);
164-
165-
bool failed = false;
163+
bool failed;
166164
zend_ulong option = zval_try_get_long(entry, &failed);
167165

168166
if (failed) {

ext/hash/hash_xxhash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ const php_hash_ops php_hash_xxh3_64_ops = {
158158
typedef XXH_errorcode (*xxh3_reset_with_secret_func_t)(XXH3_state_t*, const void*, size_t);
159159
typedef XXH_errorcode (*xxh3_reset_with_seed_func_t)(XXH3_state_t*, XXH64_hash_t);
160160

161-
zend_always_inline static void _PHP_XXH3_Init(PHP_XXH3_64_CTX *ctx, HashTable *args,
161+
static void _PHP_XXH3_Init(PHP_XXH3_64_CTX *ctx, HashTable *args,
162162
xxh3_reset_with_seed_func_t func_init_seed, xxh3_reset_with_secret_func_t func_init_secret, const char* algo_name)
163163
{
164164
memset(&ctx->s, 0, sizeof ctx->s);

ext/hash/xxhash/xxhash.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ XXH_PUBLIC_API int XXH128_cmp(const void* h128_1, const void* h128_2);
931931

932932
/******* Canonical representation *******/
933933
typedef struct { unsigned char digest[sizeof(XXH128_hash_t)]; } XXH128_canonical_t;
934-
XXH_PUBLIC_API void XXH128_canonicalFromHash(XXH128_canonical_t* dst, XXH128_hash_t hash);
934+
static zend_always_inline void XXH128_canonicalFromHash(XXH128_canonical_t* dst, XXH128_hash_t hash);
935935
XXH_PUBLIC_API XXH128_hash_t XXH128_hashFromCanonical(const XXH128_canonical_t* src);
936936

937937

@@ -5503,7 +5503,7 @@ XXH_PUBLIC_API int XXH128_cmp(const void* h128_1, const void* h128_2)
55035503

55045504
/*====== Canonical representation ======*/
55055505
/*! @ingroup xxh3_family */
5506-
XXH_PUBLIC_API void
5506+
static zend_always_inline void
55075507
XXH128_canonicalFromHash(XXH128_canonical_t* dst, XXH128_hash_t hash)
55085508
{
55095509
XXH_STATIC_ASSERT(sizeof(XXH128_canonical_t) == sizeof(XXH128_hash_t));

Zend/tests/pipe_operator/optimizations.phpt renamed to ext/opcache/tests/pipe_optimizations.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var_dump($res1);
3535
?>
3636
--EXPECTF--
3737
$_main:
38-
; (lines=18, args=0, vars=2, tmps=2)
38+
; (lines=18, args=0, vars=2, tmps=%d)
3939
; (after optimizer)
4040
; %s:1-27
4141
0000 V2 = NEW 0 string("Other")
@@ -61,7 +61,7 @@ LIVE RANGES:
6161
2: 0010 - 0011 (tmp/var)
6262

6363
_test1:
64-
; (lines=4, args=1, vars=1, tmps=1)
64+
; (lines=4, args=1, vars=1, tmps=%d)
6565
; (after optimizer)
6666
; %s:3-5
6767
0000 CV0($a) = RECV 1
@@ -70,7 +70,7 @@ _test1:
7070
0003 RETURN T1
7171

7272
Other::foo:
73-
; (lines=4, args=1, vars=1, tmps=1)
73+
; (lines=4, args=1, vars=1, tmps=%d)
7474
; (after optimizer)
7575
; %s:8-10
7676
0000 CV0($a) = RECV 1
@@ -79,7 +79,7 @@ Other::foo:
7979
0003 RETURN T1
8080

8181
Other::bar:
82-
; (lines=4, args=1, vars=1, tmps=1)
82+
; (lines=4, args=1, vars=1, tmps=%d)
8383
; (after optimizer)
8484
; %s:12-14
8585
0000 CV0($a) = RECV 1

ext/pdo_sqlite/pdo_sqlite.stub.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ class Sqlite extends \PDO
3636
/** @cvalue PDO_SQLITE_ATTR_BUSY_STATEMENT */
3737
public const int ATTR_BUSY_STATEMENT = UNKNOWN;
3838

39+
/** @cvalue PDO_SQLITE_ATTR_EXPLAIN_STATEMENT */
40+
public const int ATTR_EXPLAIN_STATEMENT = UNKNOWN;
41+
42+
#if SQLITE_VERSION_NUMBER >= 3041000
43+
public const int EXPLAIN_MODE_PREPARED = 0;
44+
public const int EXPLAIN_MODE_EXPLAIN = 1;
45+
public const int EXPLAIN_MODE_EXPLAIN_QUERY_PLAN = 2;
46+
#endif
47+
3948
/** @cvalue SQLITE_OK */
4049
public const int OK = UNKNOWN;
4150

ext/pdo_sqlite/pdo_sqlite_arginfo.h

Lines changed: 31 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/pdo_sqlite/php_pdo_sqlite_int.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ enum {
7474
PDO_SQLITE_ATTR_OPEN_FLAGS = PDO_ATTR_DRIVER_SPECIFIC,
7575
PDO_SQLITE_ATTR_READONLY_STATEMENT,
7676
PDO_SQLITE_ATTR_EXTENDED_RESULT_CODES,
77-
PDO_SQLITE_ATTR_BUSY_STATEMENT
77+
PDO_SQLITE_ATTR_BUSY_STATEMENT,
78+
PDO_SQLITE_ATTR_EXPLAIN_STATEMENT
7879
};
7980

8081
typedef int pdo_sqlite_create_collation_callback(void*, int, const void*, int, const void*);

0 commit comments

Comments
 (0)