php.net |  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: 2010-12-01 16:30 UTC
Votes:7
Avg. Score:3.6 ± 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: Open Package: Scripting Engine problem
PHP Version: 5.3SVN-2009-11-06 (SVN) OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

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

Reason:
* 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-01 16:30 UTC] jani@php.net
-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).
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Feb 24 06:01:26 2020 UTC