- Replace noLiteralString handling with getInlineString method - Add getInlineString function to generate PHP strings without literal table - Use ZEND_STRL to preserve string length with embedded NULs - Update scalar parsing to use getInlineString for noLiteralString case - Add test case for embedded null string handling - Remove skip condition for trim tests related to embedded nullspull/17/head
parent
b6cc597725
commit
fd085c10d0
3 changed files with 36 additions and 3 deletions
@ -0,0 +1,22 @@ |
|||||||
|
--TEST-- |
||||||
|
Embedded NUL bytes in string literals |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
function main(): void |
||||||
|
{ |
||||||
|
$value = "hello \0 world"; |
||||||
|
|
||||||
|
var_dump(strlen($value)); |
||||||
|
var_dump(bin2hex($value)); |
||||||
|
var_dump($value === "hello \0 world"); |
||||||
|
var_dump($value . "!" === "hello \0 world!"); |
||||||
|
var_dump(eval('return "A\\0B";') === "A\0B"); |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
int(13) |
||||||
|
string(26) "68656c6c6f200020776f726c64" |
||||||
|
bool(true) |
||||||
|
bool(true) |
||||||
|
bool(true) |
||||||
Loading…
Reference in new issue