Doc #54153 [Ver->Csd]: strlen(array) behavior change as of 5.3
| From: | philip@php.net | Date: | Mon, 21 Mar 2011 17:27:52 +0000 |
| Subject: | Doc #54153 [Ver->Csd]: strlen(array) behavior change as of 5.3 | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-6117@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(array) behavior change as of 5.3
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: redhat
PHP Version: 5.3SVN-2011-03-03 (SVN)
-Assigned To:
+Assigned To: philip
Block user comment: N
Private report: N
New Comment:
This is fixed in SVN and will show up online this upcoming Friday. Thank
you for
the bug report :)
Previous Comments:
------------------------------------------------------------------------
[2011-03-21 18:25:50] philip@php.net
Automatic comment from SVN on behalf of philip
Revision: http://svn.php.net/viewvc/?view=revision&revision=309499
Log: Documented strlen() behaviour with arrays including the 5.3 change.
Closes PHP Bug #54153
------------------------------------------------------------------------
[2011-03-03 21:18:38] philip@php.net
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.
------------------------------------------------------------------------
[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