Re: String length property (avoid strlen)
| From: | Antony Dovgal | Date: | Wed, 02 May 2007 10:34:02 +0000 |
| Subject: | Re: String length property (avoid strlen) | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969376227@lists.php.net to get a copy of this message | ||
On 05/02/2007 02:13 PM, Werner Beroux wrote:
I found an interesting note that I quote here: "[4] [...] be sure to remember that PHP holds the length property of each string, and that it shouldn't be calculated with strlen()."See http://www.php.net/manual/en/zend.variables.php String length is stored next to the string itself in zval struct.-- http://cvs.php.net/viewvc.cgi/php-src/CODING_STANDARDS?view=coNow I found nowhere anything else about this and strlen is described everywhere.
Is it some kind of new feature of PHP6?No, this is how it works for ages. -- Wbr, Antony Dovgal