|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #50099 Suggestion: Deprecate sizeof
Submitted: 2009-11-06 12:35 UTC Modified: 2021-01-08 13:08 UTC
Avg. Score:3.8 ± 1.3
Reproduced:4 of 5 (80.0%)
Same Version:1 (25.0%)
Same OS:3 (75.0%)
From: martin dot contento at gmail dot com Assigned:
Status: Suspended Package: Scripting Engine problem
PHP Version: 5.3SVN-2009-11-06 (SVN) OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: martin dot contento at gmail dot com
New email:
PHP Version: OS:


 [2009-11-06 12:35 UTC] martin dot contento at gmail dot com
Summary says it all: I would like to nominate "sizeof()" for deprecation.

* sizeof already is only an alias of count
* a deprecation warning would discourage people from using it, making php just a little bit more "unified"
* "count" is the better name, sizeof could be confused with the C function which does something different (we all had a "sizeof(array) / sizeof(array[0])" macro, didn't we?)
* it would end the (rather silly) "which function is faster" discussions around those two


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-01 16:30 UTC]
-Package: Feature/Change Request +Package: Scripting Engine problem
 [2014-03-05 20:29 UTC] narf at devilix dot net
This should be considered for PHP6 (or whatever PHP5++ is called).
 [2021-01-08 13:08 UTC]
-Status: Open +Status: Suspended
 [2021-01-08 13:08 UTC]
This needs to be discussed on the internals mailing list, and may
require an RFC[1].  Feel free to forward the request to the
mailing list.  For the time being, I'm suspending this ticket.

[1] <>
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Mar 03 16:01:24 2021 UTC