Skip to content

Commit 90bbadf

Browse files
committed
Merge tag 'php-8.4.7' into was-8.4.x
Tag for php-8.4.7
2 parents 40bf011 + ecdb771 commit 90bbadf

File tree

89 files changed

+1757
-193
lines changed

Some content is hidden

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

89 files changed

+1757
-193
lines changed

.github/scripts/windows/test_task.bat

+4-1
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,15 @@ if "%PLATFORM%" == "x64" (
5858
curl -sLo Firebird.zip %PHP_FIREBIRD_DOWNLOAD_URL%
5959
7z x -oC:\Firebird Firebird.zip
6060
set PDO_FIREBIRD_TEST_DATABASE=C:\test.fdb
61-
set PDO_FIREBIRD_TEST_DSN=firebird:dbname=%PDO_FIREBIRD_TEST_DATABASE%
61+
set PDO_FIREBIRD_TEST_DSN=firebird:dbname=127.0.0.1:%PDO_FIREBIRD_TEST_DATABASE%
6262
set PDO_FIREBIRD_TEST_USER=SYSDBA
6363
set PDO_FIREBIRD_TEST_PASS=phpfi
64+
echo create user %PDO_FIREBIRD_TEST_USER% password '%PDO_FIREBIRD_TEST_PASS%';> C:\Firebird\create_user.sql
65+
echo commit;>> C:\Firebird\create_user.sql
6466
echo create database '%PDO_FIREBIRD_TEST_DATABASE%' user '%PDO_FIREBIRD_TEST_USER%' password '%PDO_FIREBIRD_TEST_PASS%';> C:\Firebird\setup.sql
6567
C:\Firebird\instsvc.exe install -n TestInstance
6668
C:\Firebird\isql -q -i C:\Firebird\setup.sql
69+
C:\Firebird\isql -q -i C:\Firebird\create_user.sql -user sysdba %PDO_FIREBIRD_TEST_DATABASE%
6770
C:\Firebird\instsvc.exe start -n TestInstance
6871
if %errorlevel% neq 0 exit /b 3
6972
path C:\Firebird;%PATH%

.github/workflows/push.yml

+1
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ jobs:
355355
path: ${{ github.workspace }}/benchmark/profiles
356356
retention-days: 30
357357
FREEBSD:
358+
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
358359
name: FREEBSD
359360
runs-on: ubuntu-latest
360361
steps:

NEWS

+79
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,80 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3+
?? ??? ????, PHP 8.4.7
4+
5+
- Core:
6+
. Fixed bug GH-18038 (Lazy proxy calls magic methods twice). (Arnaud)
7+
. Fixed bug GH-18209 (Use-after-free in extract() with EXTR_REFS). (ilutov)
8+
. Fixed bug GH-18268 (Segfault in array_walk() on object with added property
9+
hooks). (ilutov)
10+
. Fixed bug GH-18304 (Changing the properties of a DateInterval through
11+
dynamic properties triggers a SegFault). (nielsdos)
12+
. Fix some leaks in php_scandir. (nielsdos)
13+
14+
- DBA:
15+
. FIxed bug GH-18247 dba_popen() memory leak on invalid path. (David Carlier)
16+
17+
- Filter:
18+
. Fixed bug GH-18309 (ipv6 filter integer overflow). (nielsdos)
19+
20+
- GD:
21+
. Fixed imagecrop() overflow with rect argument with x/width y/heigh usage
22+
in gdImageCrop(). (David Carlier)
23+
. Fixed GH-18243 imagettftext() overflow/underflow on font size value.
24+
(David Carlier)
25+
26+
- Intl:
27+
. Fix reference support for intltz_get_offset(). (nielsdos)
28+
29+
- LDAP:
30+
. Fixed bug GH-17776 (LDAP_OPT_X_TLS_* options can't be overridden). (Remi)
31+
. Fix NULL deref on high modification key. (nielsdos)
32+
33+
- libxml:
34+
. Fixed custom external entity loader returning an invalid resource leading
35+
to a confusing TypeError message. (Girgias)
36+
37+
- Opcache:
38+
. Fixed bug GH-18294 (assertion failure zend_jit_ir.c). (nielsdos)
39+
. Fixed bug GH-18289 (Fix segfault in JIT). (Florian Engelhardt)
40+
. Fixed bug GH-18136 (tracing JIT floating point register clobbering on
41+
Windows and ARM64). (nielsdos)
42+
43+
- OpenSSL:
44+
. Fix memory leak in openssl_sign() when passing invalid algorithm.
45+
(nielsdos)
46+
. Fix potential leaks when writing to BIO fails. (nielsdos)
47+
48+
- PDO Firebird:
49+
. Fixed bug GH-18276 (persistent connection - "zend_mm_heap corrupted"
50+
with setAttribute()) (SakiTakamachi).
51+
. Fixed bug GH-17383 (PDOException has wrong code and message since PHP 8.4)
52+
(SakiTakamachi).
53+
54+
- PDO Sqlite:
55+
. Fix memory leak on error return of collation callback. (nielsdos)
56+
57+
- PgSql:
58+
. Fix uouv in pg_put_copy_end(). (nielsdos)
59+
60+
- SPL:
61+
. Fixed bug GH-18322 (SplObjectStorage debug handler mismanages memory).
62+
(nielsdos)
63+
64+
- Standard:
65+
. Fixed bug GH-18145 (php8ts crashes in php_clear_stat_cache()).
66+
(Jakub Zelenka)
67+
. Fix resource leak in iptcembed() on error. (nielsdos)
68+
69+
- Tests:
70+
. Address deprecated PHP 8.4 session options to prevent test failures.
71+
(willvar)
72+
73+
- Zip:
74+
. Fix uouv when handling empty options in ZipArchive::addGlob(). (nielsdos)
75+
. Fix memory leak when handling a too long path in ZipArchive::addGlob().
76+
(nielsdos)
77+
378
10 Apr 2025, PHP 8.4.6
479

580
- BCMath:
@@ -72,6 +147,10 @@ PHP NEWS
72147
- PDO:
73148
. Fix memory leak when destroying PDORow. (nielsdos)
74149

150+
- PGSQL:
151+
. Fixed bug GH-18148 (pg_copy_from() regression with explicit \n terminator
152+
due to wrong offset check). (David Carlier)
153+
75154
- Standard:
76155
. Fix memory leaks in array_any() / array_all(). (nielsdos)
77156

Zend/asm/save_xmm_x86_64_ms_masm.asm

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
.code
2+
3+
; ZEND_API void execute_ex(zend_execute_data *ex)
4+
PUBLIC execute_ex
5+
6+
EXTERN execute_ex_real:PROC
7+
8+
; Assembly wrapper around the real execute_ex function, so that we can
9+
; save the preserved registers when re-entering the VM from JIT code.
10+
; See GH-18136.
11+
execute_ex PROC EXPORT FRAME
12+
; 10 floating points numbers
13+
; 32 bytes shadow space
14+
; 8 bytes to align after the return address
15+
sub rsp, 8*10 + 32 + 8
16+
.allocstack 8*10 + 32 + 8
17+
.endprolog
18+
movsd qword ptr [rsp + 32 + 8*0], xmm6
19+
movsd qword ptr [rsp + 32 + 8*1], xmm7
20+
movsd qword ptr [rsp + 32 + 8*2], xmm8
21+
movsd qword ptr [rsp + 32 + 8*3], xmm9
22+
movsd qword ptr [rsp + 32 + 8*4], xmm10
23+
movsd qword ptr [rsp + 32 + 8*5], xmm11
24+
movsd qword ptr [rsp + 32 + 8*6], xmm12
25+
movsd qword ptr [rsp + 32 + 8*7], xmm13
26+
movsd qword ptr [rsp + 32 + 8*8], xmm14
27+
movsd qword ptr [rsp + 32 + 8*9], xmm15
28+
call execute_ex_real
29+
movsd xmm6, qword ptr [rsp + 32 + 8*0]
30+
movsd xmm7, qword ptr [rsp + 32 + 8*1]
31+
movsd xmm8, qword ptr [rsp + 32 + 8*2]
32+
movsd xmm9, qword ptr [rsp + 32 + 8*3]
33+
movsd xmm10, qword ptr [rsp + 32 + 8*4]
34+
movsd xmm11, qword ptr [rsp + 32 + 8*5]
35+
movsd xmm12, qword ptr [rsp + 32 + 8*6]
36+
movsd xmm13, qword ptr [rsp + 32 + 8*7]
37+
movsd xmm14, qword ptr [rsp + 32 + 8*8]
38+
movsd xmm15, qword ptr [rsp + 32 + 8*9]
39+
add rsp, 8*10 + 32 + 8
40+
ret
41+
execute_ex ENDP
42+
43+
END
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
GH-18038 001: Lazy proxy calls magic methods twice
3+
--FILE--
4+
<?php
5+
6+
#[AllowDynamicProperties]
7+
class C {
8+
public $_;
9+
public function __set($name, $value) {
10+
var_dump(__METHOD__);
11+
$this->$name = $value * 2;
12+
}
13+
}
14+
15+
$rc = new ReflectionClass(C::class);
16+
17+
$obj = $rc->newLazyProxy(function () {
18+
echo "init\n";
19+
return new C;
20+
});
21+
22+
$obj->prop = 1;
23+
var_dump($obj->prop);
24+
25+
?>
26+
--EXPECT--
27+
string(8) "C::__set"
28+
init
29+
int(2)
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
--TEST--
2+
GH-18038 002: Lazy proxy calls magic methods twice
3+
--FILE--
4+
<?php
5+
6+
#[AllowDynamicProperties]
7+
class RealInstance {
8+
public $_;
9+
public function __set($name, $value) {
10+
global $obj;
11+
var_dump(get_class($this)."::".__FUNCTION__);
12+
$obj->$name = $value * 2;
13+
unset($this->$name);
14+
$this->$name = $value * 2;
15+
}
16+
}
17+
18+
#[AllowDynamicProperties]
19+
class Proxy extends RealInstance {
20+
}
21+
22+
$rc = new ReflectionClass(Proxy::class);
23+
24+
$obj = $rc->newLazyProxy(function () {
25+
echo "init\n";
26+
return new RealInstance;
27+
});
28+
29+
$real = $rc->initializeLazyObject($obj);
30+
$real->prop = 1;
31+
var_dump($obj->prop);
32+
33+
?>
34+
--EXPECT--
35+
init
36+
string(19) "RealInstance::__set"
37+
string(12) "Proxy::__set"
38+
int(2)
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--TEST--
2+
GH-18038 003: Lazy proxy calls magic methods twice
3+
--FILE--
4+
<?php
5+
6+
#[AllowDynamicProperties]
7+
class C {
8+
public $_;
9+
public function __get($name) {
10+
var_dump(__METHOD__);
11+
return $this->$name;
12+
}
13+
}
14+
15+
$rc = new ReflectionClass(C::class);
16+
17+
$obj = $rc->newLazyProxy(function () {
18+
echo "init\n";
19+
return new C;
20+
});
21+
22+
var_dump($obj->prop);
23+
24+
?>
25+
--EXPECTF--
26+
string(8) "C::__get"
27+
init
28+
29+
Warning: Undefined property: C::$prop in %s on line %d
30+
NULL
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
--TEST--
2+
GH-18038 004: Lazy proxy calls magic methods twice
3+
--FILE--
4+
<?php
5+
6+
#[AllowDynamicProperties]
7+
class RealInstance {
8+
public $_;
9+
public function __get($name) {
10+
global $obj;
11+
var_dump(get_class($this)."::".__FUNCTION__);
12+
var_dump($obj->$name);
13+
return $this->$name;
14+
}
15+
}
16+
17+
#[AllowDynamicProperties]
18+
class Proxy extends RealInstance {
19+
public function __get($name) {
20+
var_dump(get_class($this)."::".__FUNCTION__);
21+
return $this->$name;
22+
}
23+
}
24+
25+
$rc = new ReflectionClass(Proxy::class);
26+
27+
$obj = $rc->newLazyProxy(function () {
28+
echo "init\n";
29+
return new RealInstance;
30+
});
31+
32+
$real = $rc->initializeLazyObject($obj);
33+
var_dump($real->prop);
34+
35+
?>
36+
--EXPECTF--
37+
init
38+
string(19) "RealInstance::__get"
39+
string(12) "Proxy::__get"
40+
41+
Warning: Undefined property: RealInstance::$prop in %s on line %d
42+
NULL
43+
44+
Warning: Undefined property: RealInstance::$prop in %s on line %d
45+
NULL
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--TEST--
2+
GH-18038 005: Lazy proxy calls magic methods twice
3+
--FILE--
4+
<?php
5+
6+
#[AllowDynamicProperties]
7+
class C {
8+
public $_;
9+
public function __isset($name) {
10+
var_dump(__METHOD__);
11+
return isset($this->$name['']);
12+
}
13+
}
14+
15+
$rc = new ReflectionClass(C::class);
16+
17+
$obj = $rc->newLazyProxy(function () {
18+
echo "init\n";
19+
return new C;
20+
});
21+
22+
var_dump(isset($obj->prop['']));
23+
24+
?>
25+
--EXPECT--
26+
string(10) "C::__isset"
27+
init
28+
bool(false)
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--TEST--
2+
GH-18038 006: Lazy proxy calls magic methods twice
3+
--FILE--
4+
<?php
5+
6+
#[AllowDynamicProperties]
7+
class C {
8+
public $_;
9+
public function __isset($name) {
10+
var_dump(__METHOD__);
11+
return isset($this->$name['']);
12+
}
13+
public function __get($name) {
14+
var_dump(__METHOD__);
15+
return $this->$name[''];
16+
}
17+
}
18+
19+
$rc = new ReflectionClass(C::class);
20+
21+
$obj = $rc->newLazyProxy(function () {
22+
echo "init\n";
23+
return new C;
24+
});
25+
26+
var_dump(isset($obj->prop['']));
27+
28+
?>
29+
--EXPECTF--
30+
string(10) "C::__isset"
31+
string(8) "C::__get"
32+
init
33+
34+
Warning: Undefined property: C::$prop in %s on line %d
35+
36+
Warning: Trying to access array offset on null in %s on line %d
37+
bool(false)

0 commit comments

Comments
 (0)