Skip to content

Commit 7f51fdd

Browse files
committed
Merge tag 'php-8.4.10' into was-8.4.x
Tag for php-8.4.10
2 parents d582bca + 5b61b6d commit 7f51fdd

File tree

134 files changed

+1675
-259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+1675
-259
lines changed

NEWS

Lines changed: 97 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,102 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
05 Jun 2025 PHP 8.4.8
3+
03 Jul 2025, PHP 8.4.10
4+
5+
- BcMath:
6+
. Fixed bug GH-18641 (Accessing a BcMath\Number property by ref crashes).
7+
(nielsdos)
8+
9+
- Core:
10+
. Fixed bugs GH-17711 and GH-18022 (Infinite recursion on deprecated attribute
11+
evaluation) and GH-18464 (Recursion protection for deprecation constants not
12+
released on bailout). (DanielEScherzer and ilutov)
13+
. Fixed GH-18695 (zend_ast_export() - float number is not preserved).
14+
(Oleg Efimov)
15+
. Fix handling of references in zval_try_get_long(). (nielsdos)
16+
. Do not delete main chunk in zend_gc. (danog, Arnaud)
17+
. Fix compile issues with zend_alloc and some non-default options. (nielsdos)
18+
19+
- Curl:
20+
. Fix memory leak when setting a list via curl_setopt fails. (nielsdos)
21+
22+
- Date:
23+
. Fix leaks with multiple calls to DatePeriod iterator current(). (nielsdos)
24+
25+
- DOM:
26+
. Fixed bug GH-18744 (classList works not correctly if copy HTMLElement by
27+
clone keyword). (nielsdos)
28+
29+
- FPM:
30+
. Fixed GH-18662 (fpm_get_status segfault). (txuna)
31+
32+
- Hash:
33+
. Fixed bug GH-14551 (PGO build fails with xxhash). (nielsdos)
34+
35+
- Intl:
36+
. Fix memory leak in intl_datetime_decompose() on failure. (nielsdos)
37+
. Fix memory leak in locale lookup on failure. (nielsdos)
38+
39+
- Opcache:
40+
. Fixed bug GH-18743 (Incompatibility in Inline TLS Assembly on Alpine 3.22).
41+
(nielsdos, Arnaud)
42+
43+
- ODBC:
44+
. Fix memory leak on php_odbc_fetch_hash() failure. (nielsdos)
45+
46+
- OpenSSL:
47+
. Fix memory leak of X509_STORE in php_openssl_setup_verify() on failure.
48+
(nielsdos)
49+
. Fixed bug #74796 (Requests through http proxy set peer name).
50+
(Jakub Zelenka)
51+
52+
- PGSQL:
53+
. Fixed GHSA-hrwm-9436-5mv3 (pgsql extension does not check for errors during
54+
escaping). (CVE-2025-1735) (Jakub Zelenka)
55+
56+
- PDO ODBC:
57+
. Fix memory leak if WideCharToMultiByte() fails. (nielsdos)
58+
59+
- PDO Sqlite:
60+
. Fixed memory leak with Pdo_Sqlite::createCollation when the callback
61+
has an incorrect return type. (David Carlier)
62+
63+
- Phar:
64+
. Add missing filter cleanups on phar failure. (nielsdos)
65+
. Fixed bug GH-18642 (Signed integer overflow in ext/phar fseek). (nielsdos)
66+
67+
- PHPDBG:
68+
. Fix 'phpdbg --help' segfault on shutdown with USE_ZEND_ALLOC=0. (nielsdos)
69+
70+
- PGSQL:
71+
. Fix warning not being emitted when failure to cancel a query with
72+
pg_cancel_query(). (Girgias)
73+
74+
- Random:
75+
. Fix reference type confusion and leak in user random engine.
76+
(nielsdos, timwolla)
77+
78+
- Readline:
79+
. Fix memory leak when calloc() fails in php_readline_completion_cb().
80+
(nielsdos)
81+
82+
- SimpleXML:
83+
. Fixed bug GH-18597 (Heap-buffer-overflow in zend_alloc.c when assigning
84+
string with UTF-8 bytes). (nielsdos)
85+
86+
- SOAP:
87+
. Fix memory leaks in php_http.c when call_user_function() fails. (nielsdos)
88+
. Fixed GHSA-453j-q27h-5p8x (NULL Pointer Dereference in PHP SOAP Extension
89+
via Large XML Namespace Prefix). (CVE-2025-6491) (Lekssays, nielsdos)
90+
91+
- Standard:
92+
. Fixed GHSA-3cr5-j632-f35r (Null byte termination in hostnames).
93+
(CVE-2025-1220) (Jakub Zelenka)
94+
95+
- Tidy:
96+
. Fix memory leak in tidy output handler on error. (nielsdos)
97+
. Fix tidyOptIsReadonly deprecation, using tidyOptGetCategory. (David Carlier)
98+
99+
06 Jun 2025, PHP 8.4.8
4100

5101
- Core:
6102
. Fixed GH-18480 (array_splice with large values for offset/length arguments).
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--TEST--
2+
Serialization of floats are correct
3+
--INI--
4+
zend.assertions=1
5+
--FILE--
6+
<?php
7+
try {
8+
assert(!is_float(0.0));
9+
} catch (AssertionError $e) {
10+
echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
11+
}
12+
try {
13+
assert(!is_float(1.1));
14+
} catch (AssertionError $e) {
15+
echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
16+
}
17+
try {
18+
assert(!is_float(1234.5678));
19+
} catch (AssertionError $e) {
20+
echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
21+
}
22+
?>
23+
--EXPECT--
24+
assert(): assert(!is_float(0.0)) failed
25+
assert(): assert(!is_float(1.1)) failed
26+
assert(): assert(!is_float(1234.5678)) failed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--TEST--
2+
GH-17711: Infinite recursion through deprecated class constants self-referencing through deprecation message
3+
--FILE--
4+
<?php
5+
6+
class C {
7+
#[\Deprecated(self::C)]
8+
const C = TEST;
9+
}
10+
11+
const TEST = 'Message';
12+
var_dump(C::C);
13+
14+
class D {
15+
#[\Deprecated(Alias::C)]
16+
const C = 'test';
17+
}
18+
19+
class_alias('D', 'Alias');
20+
var_dump(D::C);
21+
22+
?>
23+
--EXPECTF--
24+
Deprecated: Constant C::C is deprecated, Message in %s on line %d
25+
string(7) "Message"
26+
27+
Deprecated: Constant D::C is deprecated, test in %s on line %d
28+
string(4) "test"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
GH-18463: Recursion protection should not be applied to internal class constants
3+
--EXTENSIONS--
4+
zend_test
5+
--FILE--
6+
<?php
7+
8+
function handler($errno, $errstr, $errfile, $errline) {
9+
echo "$errstr in $errfile on line $errline\n";
10+
eval('class string {}');
11+
}
12+
13+
set_error_handler('handler');
14+
15+
var_dump(_ZendTestClass::ZEND_TEST_DEPRECATED);
16+
?>
17+
--EXPECTF--
18+
Constant _ZendTestClass::ZEND_TEST_DEPRECATED is deprecated in %s on line %d
19+
20+
Fatal error: Cannot use "string" as a class name as it is reserved in %s(%d) : eval()'d code on line %d

Zend/tests/exception_027.phpt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--TEST--
2+
Exception properties are overridden by property hooks
3+
--FILE--
4+
<?php
5+
class MyException extends Exception
6+
{
7+
private bool $modified = false;
8+
9+
protected $code {
10+
set($value) {
11+
if ($this->modified) {
12+
throw new Exception();
13+
} else {
14+
$this->modified = true;
15+
16+
$this->code = $value;
17+
}
18+
}
19+
}
20+
}
21+
22+
$e = new MyException("foo", 1, new Exception());
23+
24+
try {
25+
$e->__construct("bar", 2, null);
26+
} catch (Exception) {
27+
}
28+
29+
var_dump($e->getMessage());
30+
var_dump($e->getCode());
31+
var_dump($e->getPrevious()::class);
32+
33+
?>
34+
--EXPECTF--
35+
string(3) "bar"
36+
int(1)
37+
string(9) "Exception"

Zend/tests/exception_028.phpt

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
--TEST--
2+
ErrorException properties are overridden by property hooks
3+
--FILE--
4+
<?php
5+
class MyException extends ErrorException
6+
{
7+
private bool $modified = false;
8+
9+
protected $code {
10+
set($value) {
11+
if ($this->modified) {
12+
throw new Exception();
13+
} else {
14+
$this->modified = true;
15+
16+
$this->code = $value;
17+
}
18+
}
19+
}
20+
}
21+
22+
$e = new MyException("foo", 1, E_NOTICE, "file1", 1, new Exception());
23+
24+
try {
25+
$e->__construct("bar", 2, E_WARNING, "file2", 2, null);
26+
} catch (Exception) {
27+
}
28+
29+
var_dump($e->getMessage());
30+
var_dump($e->getCode());
31+
var_dump($e->getSeverity());
32+
var_dump($e->getFile());
33+
var_dump($e->getLine());
34+
var_dump($e->getPrevious()::class);
35+
36+
?>
37+
--EXPECTF--
38+
string(3) "bar"
39+
int(1)
40+
int(8)
41+
string(5) "file1"
42+
int(1)
43+
string(9) "Exception"

Zend/tests/gh18756.phpt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--TEST--
2+
Bug GH-18756: Zend MM may delete the main chunk
3+
--EXTENSIONS--
4+
zend_test
5+
--FILE--
6+
<?php
7+
8+
zend_test_gh18756();
9+
10+
?>
11+
==DONE==
12+
--EXPECT--
13+
==DONE==

Zend/zend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#ifndef ZEND_H
2121
#define ZEND_H
2222

23-
#define ZEND_VERSION "4.4.8"
23+
#define ZEND_VERSION "4.4.10"
2424

2525
#define ZEND_ENGINE_3
2626

Zend/zend_API.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ ZEND_API HashTable *zend_separate_class_constants_table(zend_class_entry *class_
14381438

14391439
ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&class_type->constants_table, key, c) {
14401440
if (c->ce == class_type) {
1441-
if (Z_TYPE(c->value) == IS_CONSTANT_AST) {
1441+
if (Z_TYPE(c->value) == IS_CONSTANT_AST || (ZEND_CLASS_CONST_FLAGS(c) & ZEND_ACC_DEPRECATED)) {
14421442
new_c = zend_arena_alloc(&CG(arena), sizeof(zend_class_constant));
14431443
memcpy(new_c, c, sizeof(zend_class_constant));
14441444
c = new_c;

Zend/zend_alloc.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2195,7 +2195,7 @@ ZEND_API size_t zend_mm_gc(zend_mm_heap *heap)
21952195
i++;
21962196
}
21972197
}
2198-
if (chunk->free_pages == ZEND_MM_PAGES - ZEND_MM_FIRST_PAGE) {
2198+
if (chunk->free_pages == ZEND_MM_PAGES - ZEND_MM_FIRST_PAGE && chunk != heap->main_chunk) {
21992199
zend_mm_chunk *next_chunk = chunk->next;
22002200

22012201
zend_mm_delete_chunk(heap, chunk);
@@ -2422,7 +2422,9 @@ ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, bool full, bool silent)
24222422
/* Make sure the heap free below does not use tracked_free(). */
24232423
heap->custom_heap._free = __zend_free;
24242424
}
2425+
#if ZEND_MM_STAT
24252426
heap->size = 0;
2427+
#endif
24262428
}
24272429

24282430
void (*shutdown)(bool, bool) = heap->custom_heap._shutdown;
@@ -2960,6 +2962,7 @@ static zend_always_inline zval *tracked_get_size_zv(zend_mm_heap *heap, void *pt
29602962
}
29612963

29622964
static zend_always_inline void tracked_check_limit(zend_mm_heap *heap, size_t add_size) {
2965+
#if ZEND_MM_STAT
29632966
if (add_size > heap->limit - heap->size && !heap->overflow) {
29642967
#if ZEND_DEBUG
29652968
zend_mm_safe_error(heap,
@@ -2971,6 +2974,7 @@ static zend_always_inline void tracked_check_limit(zend_mm_heap *heap, size_t ad
29712974
heap->limit, add_size);
29722975
#endif
29732976
}
2977+
#endif
29742978
}
29752979

29762980
static void *tracked_malloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
@@ -2984,7 +2988,9 @@ static void *tracked_malloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC
29842988
}
29852989

29862990
tracked_add(heap, ptr, size);
2991+
#if ZEND_MM_STAT
29872992
heap->size += size;
2993+
#endif
29882994
return ptr;
29892995
}
29902996

@@ -2995,7 +3001,9 @@ static void tracked_free(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) {
29953001

29963002
zend_mm_heap *heap = AG(mm_heap);
29973003
zval *size_zv = tracked_get_size_zv(heap, ptr);
3004+
#if ZEND_MM_STAT
29983005
heap->size -= Z_LVAL_P(size_zv);
3006+
#endif
29993007
zend_hash_del_bucket(heap->tracked_allocs, (Bucket *) size_zv);
30003008
free(ptr);
30013009
}
@@ -3020,7 +3028,9 @@ static void *tracked_realloc(void *ptr, size_t new_size ZEND_FILE_LINE_DC ZEND_F
30203028

30213029
ptr = __zend_realloc(ptr, new_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
30223030
tracked_add(heap, ptr, new_size);
3031+
#if ZEND_MM_STAT
30233032
heap->size += new_size - old_size;
3033+
#endif
30243034
return ptr;
30253035
}
30263036

0 commit comments

Comments
 (0)