|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-01-19 12:38 UTC] jani@php.net
[2009-01-19 13:14 UTC] llongo at sata-hts dot com
[2009-01-19 13:51 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 07:00:01 2025 UTC |
Description: ------------ Passing to strlen a string with a particular sequence of characters (binary + ascii), strlen returns the wrong number of characters. The architecture of the host where the problem has happened is x86_64 The php configure is: ./configure --with-openssl --with-zlib --enable-zip --with-pear --with- mysql --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-shmop --enable-pcntl --enable-bcmath --with-apxs 2 --with-gettext --with-gdbm --enable-sockets --enable-mbstring --with-imap-ssl --with-libdir=lib64 Reproduce code: --------------- $pack_str = pack("N",240); // binary string $msg = "<msg>"; // ascii string echo "pack_str: ".strlen($pack_str)."\n"; // OK echo "msg: ".strlen($msg)."\n"; // OK $new_str = $pack_str.$msg; echo "strlen: ".strlen($new_str)."\n"; // KO Expected result: ---------------- The expected result of last echo is: strlen: 9 Actual result: -------------- The actual result of last echo is: strlen: 6