Doc #54153 [Opn->Ver]: strlen(array) behavior change as of 5.3
| From: | philip@php.net | Date: | Thu, 03 Mar 2011 20:18:38 +0000 |
| Subject: | Doc #54153 [Opn->Ver]: strlen(array) behavior change as of 5.3 | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-6048@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54153&edit=1
ID: 54153
Updated by: philip@php.net
Reported by: ghensley at gmail dot com
-Summary: Strlen when called on an array ini php 5.3
+Summary: strlen(array) behavior change as of 5.3
-Status: Open
+Status: Verified
Type: Documentation Problem
Package: Documentation problem
Operating System: redhat
PHP Version: 5.3SVN-2011-03-03 (SVN)
Block user comment: N
Private report: N
New Comment:
Confirmed, sort of.
PHP versions prior to 5.3 will always return 5, because the string
'Array' has a
length of 5 (it also emits an E_NOTICE error). As of 5.3, it returns
NULL and
emits an E_WARNING error.
Previous Comments:
------------------------------------------------------------------------
[2011-03-03 20:52:03] ghensley at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.strlen#Description
---
I found a "bug" when upgrading from php 5.2.9.
In 5.2.9 stelen when invoked on an array would return the size of the
array
In 5.3.3 strlen when invoked on an array returns null
This behavior was sort of unexpected. The documentation might want to
reflect the change - or the function should maybe throw a warning or
error.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54153&edit=1