note 78410 deleted from function.substr by danbrown

From: Date: Fri, 28 Nov 2008 20:19:01 +0000
Subject: note 78410 deleted from function.substr by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-147198@lists.php.net to get a copy of this message
Note Submitter: Jim ---- Just want to note that if you are retrieving sub-strings of length zero, this function breaks in the base case (the source being an empty string): substr('123',0,0) returns string(0) "" substr('12',0,0) returns string(0) "" substr('1',0,0) returns string(0) "" but substr('',0,0) returns bool(false) Although this is the documented behavior, I would consider it unexpected in many circumstances.

« previous php.notes (#147198) next »