Skip to content

Commit 4ac6afa

Browse files
committed
Merge tag 'php-8.3.21' into was-8.3.x
Tag for php-8.3.21
2 parents 1575fca + 2d2a210 commit 4ac6afa

Some content is hidden

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

53 files changed

+747
-115
lines changed

.github/workflows/push.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ jobs:
337337
$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.sha }}) \
338338
> $GITHUB_STEP_SUMMARY
339339
FREEBSD:
340+
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
340341
name: FREEBSD
341342
runs-on: ubuntu-latest
342343
steps:

NEWS

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,58 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3+
08 May 2025, PHP 8.3.21
4+
5+
- Core:
6+
. Fixed bug GH-18304 (Changing the properties of a DateInterval through
7+
dynamic properties triggers a SegFault). (nielsdos)
8+
. Fix some leaks in php_scandir. (nielsdos)
9+
10+
- Filter:
11+
. Fixed bug GH-18309 (ipv6 filter integer overflow). (nielsdos)
12+
13+
- GD:
14+
. Fixed imagecrop() overflow with rect argument with x/width y/heigh usage
15+
in gdImageCrop(). (David Carlier)
16+
. Fixed GH-18243 imagettftext() overflow/underflow on font size value.
17+
(David Carlier)
18+
19+
- Intl:
20+
. Fix reference support for intltz_get_offset(). (nielsdos)
21+
22+
- LDAP:
23+
. Fixed bug GH-17776 (LDAP_OPT_X_TLS_* options can't be overridden). (Remi)
24+
. Fix NULL deref on high modification key. (nielsdos)
25+
26+
- libxml:
27+
. Fixed custom external entity loader returning an invalid resource leading
28+
to a confusing TypeError message. (Girgias)
29+
30+
- OpenSSL:
31+
. Fix memory leak in openssl_sign() when passing invalid algorithm.
32+
(nielsdos)
33+
. Fix potential leaks when writing to BIO fails. (nielsdos)
34+
35+
- PDO Firebird:
36+
. Fixed GH-18276 - persistent connection - "zend_mm_heap corrupted"
37+
with setAttribute() (SakiTakamachi).
38+
39+
- SPL:
40+
. Fixed bug GH-18322 (SplObjectStorage debug handler mismanages memory).
41+
(nielsdos)
42+
43+
- Standard:
44+
. Fixed bug GH-18145 (php8ts crashes in php_clear_stat_cache()).
45+
(Jakub Zelenka)
46+
. Fixed bug GH-18209 (Use-after-free in extract() with EXTR_REFS). (ilutov)
47+
. Fixed bug GH-18212 (fseek with SEEK_CUR whence value and negative offset
48+
leads to negative stream position). (David Carlier)
49+
. Fix resource leak in iptcembed() on error. (nielsdos)
50+
51+
- Zip:
52+
. Fix uouv when handling empty options in ZipArchive::addGlob(). (nielsdos)
53+
. Fix memory leak when handling a too long path in ZipArchive::addGlob().
54+
(nielsdos)
55+
356
10 Apr 2025, PHP 8.3.20
457

558
- Core:

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.3.20"
23+
#define ZEND_VERSION "4.3.21"
2424

2525
#define ZEND_ENGINE_3
2626

benchmark/generate_diff.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function main(?string $headCommitHash, ?string $baseCommitHash) {
1010

1111
$repo = __DIR__ . '/repos/data';
1212
cloneRepo($repo, '[email protected]:php/benchmarking-data.git');
13+
$baseCommitHash = find_benchmarked_commit_hash($repo, $baseCommitHash);
1314
$headSummaryFile = $repo . '/' . substr($headCommitHash, 0, 2) . '/' . $headCommitHash . '/summary.json';
1415
$baseSummaryFile = $repo . '/' . substr($baseCommitHash, 0, 2) . '/' . $baseCommitHash . '/summary.json';
1516
if (!file_exists($headSummaryFile)) {
@@ -60,6 +61,28 @@ function formatDiff(?int $baseInstructions, int $headInstructions): string {
6061
return sprintf('%.2f%%', $instructionDiff / $baseInstructions * 100);
6162
}
6263

64+
function find_benchmarked_commit_hash(string $repo, string $commitHash): ?string {
65+
$repeat = 10;
66+
67+
while (true) {
68+
if ($repeat-- <= 0) {
69+
fwrite(STDERR, "Count not find benchmarked commit hash\n");
70+
exit(1);
71+
}
72+
$summaryFile = $repo . '/' . substr($commitHash, 0, 2) . '/' . $commitHash . '/summary.json';
73+
if (file_exists($summaryFile)) {
74+
break;
75+
}
76+
$commitHash = trim(runCommand(
77+
['git', 'rev-parse', $commitHash . '^'],
78+
dirname(__DIR__),
79+
printCommand: false,
80+
)->stdout);
81+
}
82+
83+
return $commitHash;
84+
}
85+
6386
$headCommitHash = $argv[1] ?? null;
6487
$baseCommitHash = $argv[2] ?? null;
6588
$output = main($headCommitHash, $baseCommitHash);

benchmark/shared.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ class ProcessResult {
55
public $stderr;
66
}
77

8-
function runCommand(array $args, ?string $cwd = null): ProcessResult {
8+
function runCommand(array $args, ?string $cwd = null, bool $printCommand = true): ProcessResult {
99
$cmd = implode(' ', array_map('escapeshellarg', $args));
1010
$pipes = null;
1111
$result = new ProcessResult();
1212
$descriptorSpec = [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']];
13-
fwrite(STDOUT, "> $cmd\n");
13+
if ($printCommand) {
14+
fwrite(STDOUT, "> $cmd\n");
15+
}
1416
$processHandle = proc_open($cmd, $descriptorSpec, $pipes, $cwd ?? getcwd(), null);
1517

1618
$stdin = $pipes[0];

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dnl Basic autoconf initialization, generation of config.nice.
2020
dnl ----------------------------------------------------------------------------
2121

2222
AC_PREREQ([2.68])
23-
AC_INIT([PHP],[8.3.20],[https://github.com/php/php-src/issues],[php],[https://www.php.net])
23+
AC_INIT([PHP],[8.3.21],[https://github.com/php/php-src/issues],[php],[https://www.php.net])
2424
AC_CONFIG_SRCDIR([main/php_version.h])
2525
AC_CONFIG_AUX_DIR([build])
2626
AC_PRESERVE_HELP_ORDER

ext/date/php_date.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4399,7 +4399,9 @@ static zval *date_interval_get_property_ptr_ptr(zend_object *object, zend_string
43994399
zend_string_equals_literal(name, "days") ||
44004400
zend_string_equals_literal(name, "invert") ) {
44014401
/* Fallback to read_property. */
4402-
cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
4402+
if (cache_slot) {
4403+
cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
4404+
}
44034405
ret = NULL;
44044406
} else {
44054407
ret = zend_std_get_property_ptr_ptr(object, name, type, cache_slot);

ext/date/tests/gh18304.phpt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
--TEST--
2+
GH-18304 (Changing the properties of a DateInterval through dynamic properties triggers a SegFault)
3+
--CREDITS--
4+
orose-assetgo
5+
--FILE--
6+
<?php
7+
$di = new \DateInterval('P0Y');
8+
$field = 'd';
9+
$i = 1;
10+
$di->$field += $i;
11+
var_dump($di);
12+
?>
13+
--EXPECT--
14+
object(DateInterval)#1 (10) {
15+
["y"]=>
16+
int(0)
17+
["m"]=>
18+
int(0)
19+
["d"]=>
20+
int(1)
21+
["h"]=>
22+
int(0)
23+
["i"]=>
24+
int(0)
25+
["s"]=>
26+
int(0)
27+
["f"]=>
28+
float(0)
29+
["invert"]=>
30+
int(0)
31+
["days"]=>
32+
bool(false)
33+
["from_string"]=>
34+
bool(false)
35+
}

ext/dom/php_dom.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ static zval *dom_get_property_ptr_ptr(zend_object *object, zend_string *name, in
303303
return zend_std_get_property_ptr_ptr(object, name, type, cache_slot);
304304
}
305305

306-
cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
306+
if (cache_slot) {
307+
cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
308+
}
307309
return NULL;
308310
}
309311

ext/dom/tests/gh18304.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
GH-18304 (Changing the properties of a DateInterval through dynamic properties triggers a SegFault)
3+
--CREDITS--
4+
orose-assetgo
5+
--EXTENSIONS--
6+
dom
7+
--FILE--
8+
<?php
9+
$text = new \DOMText();
10+
$field = 'textContent';
11+
$text->$field .= 'hello';
12+
var_dump($text->$field);
13+
?>
14+
--EXPECT--
15+
string(5) "hello"

0 commit comments

Comments
 (0)