Re: [Discussion] Deprecate function sizeof()

From: Date: Mon, 09 Mar 2015 04:02:55 +0000
Subject: Re: [Discussion] Deprecate function sizeof()
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-84453@lists.php.net to get a copy of this message
On 9 March 2015 at 06:44, Pierre Joye <pierre.php@gmail.com> wrote: > On Sun, Mar 8, 2015 at 2:51 AM, reeze <reeze@php.net> wrote: > > Hi internals, > > > > I'd like to deprecate function: sizeof() [1][2], which is an alias of > > count(). some people > > expect it return the memory size of the variable. > > > > The doc page's[1] user contributed notes indicate that too. > > > > What do you think? > > As I tend to like the idea to cleanup things, adding warning and > deprecation warnings for the sake of it is not too appealing to me. > Especially for this kind of things. > Yes it will not really fix the confusion, and it is a small problem, I know few decent projects use sizeof, we could make the old code involve and more consist. sizeof() was kept because of BC since PHP4.0, count() should be the recommended function. > > Cheers, > -- > Pierre > > @pierrejoye | http://www.libgd.org > -- Reeze Xia http://reeze.cn

« previous php.internals (#84453) next »