- Notifications
You must be signed in to change notification settings - Fork8k
Closed
Description
Description
The following code:
<?phpecho"hello\0world";
✅ Results in this output when executed withphp8.3
(alsophp8.2
andphp8.1
andphp8.0
):
helloworld
❌ But results in this output when executed withphpdbg8.3
(alsophpdbg8.2
andphpdbg8.1
):
hello
And I expected this output fromphpdbg8.*
instead:
helloworld
❔Interesting thing is thatphpdbg8.0
output is correct:
helloworld
... so the change in behavior seems to be somewhere in between latest8.0.*
and8.1
.
Steps to reproduce with docker
php8.0 ✅
docker run -it php:8.0-cli bash -c 'php --version; echo; echo "<?php echo \"hello\" . chr(0) . \"world\";" > lol.php; echo -n "php .|"; php lol.php; echo -en "|.\nphpdbg .|"; phpdbg -qrrb lol.php; echo "|."'PHP 8.0.30 (cli) (built: Nov 21 2023 16:10:15) ( NTS )Copyright (c) The PHP GroupZend Engine v4.0.30, Copyright (c) Zend Technologiesphp .|helloworld|.phpdbg .|helloworld|.
php8.1 ❌
docker run -it php:8.1-cli bash -c 'php --version; echo; echo "<?php echo \"hello\" . chr(0) . \"world\";" > lol.php; echo -n "php .|"; php lol.php; echo -en "|.\nphpdbg .|"; phpdbg -qrrb lol.php; echo "|."'PHP 8.1.29 (cli) (built: Jun 13 2024 03:00:05) (NTS)Copyright (c) The PHP GroupZend Engine v4.1.29, Copyright (c) Zend Technologiesphp .|helloworld|.phpdbg .|hello|.
php8.2 ❌
docker run -it php:8.2-cli bash -c 'php --version; echo; echo "<?php echo \"hello\" . chr(0) . \"world\";" > lol.php; echo -n "php .|"; php lol.php; echo -en "|.\nphpdbg .|"; phpdbg -qrrb lol.php; echo "|."'PHP 8.2.20 (cli) (built: Jun 13 2024 02:30:07) (NTS)Copyright (c) The PHP GroupZend Engine v4.2.20, Copyright (c) Zend Technologiesphp .|helloworld|.phpdbg .|hello|.
php8.3 ❌
docker run -it php:8.3-cli bash -c 'php --version; echo; echo "<?php echo \"hello\" . chr(0) . \"world\";" > lol.php; echo -n "php .|"; php lol.php; echo -en "|.\nphpdbg .|"; phpdbg -qrrb lol.php; echo "|."'PHP 8.3.8 (cli) (built: Jun 13 2024 01:58:54) (NTS)Copyright (c) The PHP GroupZend Engine v4.3.8, Copyright (c) Zend Technologiesphp .|helloworld|.phpdbg .|hello|.
PHP Version
PHP 8,1-8.3
Operating System
WSL1, WSL2 and also bare Ubuntu