Re: [PHP4BETA] new array function names

From: Date: Mon, 07 Jun 1999 15:49:04 +0000
Subject: Re: [PHP4BETA] new array function names
References: 1 2  Groups: php.version4 
Request: Send a blank email to php-version4+get-1366@lists.php.net to get a copy of this message
Zeev Suraski wrote: > > At 00:14 06/06/99 , Monte Ohrt wrote: > >Andrey has just submitted some new array functions to PHP. > >Question is, should these function names remain: > > > >push() > >pop() > >shift() > >unshift() > >slice() > >splice() > > > >or should we follow the convention: > > > >array_push() > >array_pop() > >array_shift() > >array_unshift() > >array_slice() > >array_splice() > > > > > >My thoughts: > > > >These will most likely be relatively widely used PHP functions, > >so I kind like them the way they are, easy to type and remember. > > > >And they match the perl function name counterparts, > >if that has any bearing. > > > >Other thoughts? > > First, congrats on the new useful functions. > About naming, I agree that these functions will probably be widely > used. The only problem with naming them with these names is breaking > downwards compatibility. Anyone that wrote a function named slice() would > be bitten. > I'd find something in between, some prefix that would make that clash less > likely, but not as clumsy as array_*()... If we don't go with the real short names (to avoid function name collision), I like array_*(). Not the shortest name, but easy to remember. It's not much worse than preg_*() :-) Monte

« previous php.version4 (#1366) next »