Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84322 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90485 invoked from network); 5 Mar 2015 08:08:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Mar 2015 08:08:03 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.48 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.192.48 mail-qg0-f48.google.com Received: from [209.85.192.48] ([209.85.192.48:42053] helo=mail-qg0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5A/24-56703-1EE08F45 for ; Thu, 05 Mar 2015 03:08:01 -0500 Received: by qgfi50 with SMTP id i50so3965318qgf.9 for ; Thu, 05 Mar 2015 00:07:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=83LAtkNm2BlAqUjrisuuaXaeXaApnWpiCm4KpWU9yCM=; b=Lo+u1mGryP6QpP02SNq26WC4WLtiBaLuAwl0yg8QYC7Nweu5DrYQhuFE0F1akCw9YG 7MCE6GBjSYQWpB1kNzFaAUS5P20XNQgpP0RfnLgsd07Gd4i7dgn/FfICII8T98txEzmy OQbIKgrsGg/+nP6Lk74TXdHd77UGcEe0a0hVX3qPPHx/oYy16ND6VSkhO0um/M3WPKxN 9JPAIqR6q4QRmUExoNhv1NuNOjvXU0px4A7FazUZhPOAhm8baiLZN8iGpiqvOUe0ik7M bQw05F2W103C07VvFsTg/U0U2+3YLJE0CYnwpQCqr88nUPYG7ojMpW8O7m36L3osYpXY zLmg== X-Received: by 10.140.39.179 with SMTP id v48mr10565790qgv.77.1425542879286; Thu, 05 Mar 2015 00:07:59 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.198.8 with HTTP; Thu, 5 Mar 2015 00:07:19 -0800 (PST) In-Reply-To: References: Date: Thu, 5 Mar 2015 17:07:19 +0900 X-Google-Sender-Auth: y6XlhdI10ab-rjRoUY0pfrmQGiY Message-ID: To: Benoit Schildknecht Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c131f6eea15405108610a1 Subject: Re: [PHP-DEV] Re: [RFC] [DISCUSSION] Consistent Function Names From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c131f6eea15405108610a1 Content-Type: text/plain; charset=UTF-8 Hi Benoit, On Wed, Mar 4, 2015 at 2:34 AM, Benoit Schildknecht wrote: > I think the new functions must have consistent parameters order too. I > think it is about the right time, so we'll have a cleaner and more logical > language. > > ATM, it's a real headache, we constantly have to read the documentation to > make sure we give the arguments in the right order. > > For instance > - implode() : "implode() can, for historical reasons, accept its > parameters in either order. " > - strpos( $haystack, $needle ) > - in_array( $needle, $haystack ) > $needle should be 2nd argument like int strpos ( string $haystack , mixed $needle [, int $offset= 0 ] ) string stristr ( string $haystack , mixed $needle [, bool $before_needle = false ] ) Rasmus suggested to have IEEE 1003.1 compliance. I like the idea and I'll add this in the RFC, probably. These are the order of parameters. So array functions are subject to be changed. bool in_array ( mixed $needle , array $haystack [, bool $strict ] ) Renamed to array_in() and fix order. mixed array_search ( mixed $needle , array $haystack [, bool $strict ] ) Renamed to array_find() and fix order. bool array_key_exists ( mixed $key , array $array ) Renamed to array_key_find() and fix order. array array_keys ( array $array [, mixed $search_value [, bool $strict = false ]] ) OK as it is now. implode() may be changed to have string implode ( string $glue , array $pieces ) always. If there are missing functions, please let me know. I'll try to address. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c131f6eea15405108610a1--