Edit report at http://bugs.php.net/bug.php?id=53261&edit=1
ID: 53261 Updated by: [email protected] Reported by: start-v at qq dot com Summary: strlen -Status: Open +Status: Bogus Type: Bug Package: Strings related Operating System: FreeBSD 8.1 PHP Version: 5.3.3 Block user comment: N New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. In $str [ 1 ] = '';, the second character is replaced by \x00. Previous Comments: ------------------------------------------------------------------------ [2010-11-08 05:28:53] start-v at qq dot com Description: ------------ <?php $str = ''; var_dump ( $str ); // string(0)"" // strlen ( $str ) // 0 Normal ?> <?php $str = 'str'; $str [ 1 ] = ''; var_dump ( $str ); // string(3) "sr" // strlen ( $str ) // 3 Bug ?> <?php $str = 'str'; $str = str_replace( $str [ 1 ], '', $str ); var_dump ( $str ); // string(2) "sr" // strlen ( $str ) // 2 Solution ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53261&edit=1
