Edit report at https://bugs.php.net/bug.php?id=62703&edit=1

 ID:                 62703
 Updated by:         [email protected]
 Reported by:        spam02 at live dot com
 Summary:            substr() length=null
-Status:             Open
+Status:             Wont fix
 Type:               Bug
 Package:            Strings related
 Operating System:   Linux
 PHP Version:        5.3.15
 Block user comment: N
 Private report:     N

 New Comment:

This is documented behaviour: if the length parameter weakly evaluates to 
int(0), false, null or an empty string may be returned. We can't fix this 
without a BC break, and I don't think it's worth it, personally.


Previous Comments:
------------------------------------------------------------------------
[2012-07-31 14:38:15] [email protected]

yeah, null also can be considered as 0, so, this is a little confused. the fix 
will be easy, however fixing this might introduce bc break(not sure)

------------------------------------------------------------------------
[2012-07-31 11:17:46] spam02 at live dot com

Description:
------------
seems null = not empty in mb_substr()...
//example
$text = 'test';

mb_substr($text,-1);  //result t
mb_substr($text,-1,null) //result '' expected t
substr($text,-1); //result t
substr($text,-1, null) //result '' expected t
php version 5.3.3-7+squeeze13



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62703&edit=1

Reply via email to