Re: PHP 6.0 Wishlist
| From: | Aidan Lister | Date: | Sun, 14 Aug 2005 04:41:03 +0000 |
| Subject: | Re: PHP 6.0 Wishlist | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-18033@lists.php.net to get a copy of this message | ||
"Jani Taskinen" <sniper@iki.fi> wrote in message
news:Pine.LNX.4.61.0508140342570.20280@arfg.argcubovn.sv...
> On Sat, 13 Aug 2005, Marco Tabini wrote:
>
>> Or maybe so that you don't have to look at the manual fifteen times a
>> minute
>> so that you can remember whether the needle goes before the haystack in a
>> particular function or not.
>
> I'm all for making this consistent all around.
> Best way to get this done is propably to first come up
> with a list of functions which are inconsistent?
> And get a concensus over it. :)
>
> This is the first one that comes to my mind:
>
> int strpos (string haystack, mixed needle [, int offset])
>
> Whenever I've used that, I've ALWAYS mixed the needle with haystack.
> Same goes with every str* function, I guess..
>
> --Jani
I think PHP 6.0 provides an excellent opportunity to rectify a huge number
of frustrating inconsistencies; it would be a shame not to make the most of
this.
The two biggest inconsistencies raised by users and "language comparison"
groups are a) function argument order, and b) function naming.
Granted, swapping the arguments will be nightmarish for the users. However,
we have a long time to discuss possibilities to alleviate the problem. I
agree with Jani, a list of inconsistencies should be compiled and discussed.
If it is decided that swapping the function arguments around would be too
cataclysmic for upgrading users, we should at the very least institute a new
strict function naming policy.
My favourite example of inconsistency is htmlentities and
html_entity_decode. These are easy to fix, and a relatively easy BC break
for the user to deal with.
I suggest we extend Jani's previous suggestion; by including a list of
function name inconsistencies in the discussion.
Kind regards,
Aidan Lister