Skip to content

Commit 830bb6c

Browse files
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
2 parents a71a321 + 955a2ce commit 830bb6c

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
GH-22658: ReflectionConstant with a string value with a null byte
3+
--FILE--
4+
<?php
5+
6+
define('DEMO', "f\0oo");
7+
$r = new ReflectionConstant('DEMO');
8+
echo $r;
9+
var_dump( $r->getValue() );
10+
11+
?>
12+
--EXPECTF--
13+
Constant [ string DEMO ] { f%0oo }
14+
string(4) "f%0oo"

0 commit comments

Comments
 (0)