[php-src] master: Merge branch 'PHP-8.5'
Daniel Scherzer <[email protected]>
| Newsgroups | gmane.comp.php.cvs.general |
|---|---|
| Message-ID | <[email protected]> |
Author: Daniel Scherzer (DanielEScherzer)
Date: 2026-07-10T11:08:00-07:00
Commit: https://github.com/php/php-src/commit/830bb6ca0b2b747d43051f96cc15ed8814773f6d
Raw diff: https://github.com/php/php-src/commit/830bb6ca0b2b747d43051f96cc15ed8814773f6d.diff
Merge branch 'PHP-8.5'
* PHP-8.5:
[8.5] NEWS: add entry for bugfix from GH-22659
NEWS
GH-22658: avoid truncation on null bytes in `ReflectionConstant::__toString()`
Add regression tests for `ReflectionConstant::__toString()` with null bytes
Changed paths:
A ext/reflection/tests/ReflectionConstant_null_byte_value.phpt
Diff:
diff --git a/ext/reflection/tests/ReflectionConstant_null_byte_value.phpt b/ext/reflection/tests/ReflectionConstant_null_byte_value.phpt
new file mode 100644
index 000000000000..8b6a8e85c2fc
--- /dev/null
+++ b/ext/reflection/tests/ReflectionConstant_null_byte_value.phpt
@@ -0,0 +1,14 @@
+--TEST--
+GH-22658: ReflectionConstant with a string value with a null byte
+--FILE--
+<?php
+
+define('DEMO', "f\0oo");
+$r = new ReflectionConstant('DEMO');
+echo $r;
+var_dump( $r->getValue() );
+
+?>
+--EXPECTF--
+Constant [ string DEMO ] { f%0oo }
+string(4) "f%0oo"