Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84389 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29142 invoked from network); 6 Mar 2015 23:04:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Mar 2015 23:04:10 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.42 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.218.42 mail-oi0-f42.google.com Received: from [209.85.218.42] ([209.85.218.42:35432] helo=mail-oi0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8C/31-15314-9623AF45 for ; Fri, 06 Mar 2015 18:04:09 -0500 Received: by oifz81 with SMTP id z81so20276954oif.2 for ; Fri, 06 Mar 2015 15:04:06 -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=dzhox197uV5JFuajbCRyCRcBL+nsh6wjxl3l3RaK1MM=; b=iZJ8qZHkpnCjNviUaaeUHbxSXAo8u+QcbdK7sgDkGRqcZ2t17f1Gl1EQ4ZLHpQUG/V TEJz0o5qzjXxzDa6WAjjX0IeZl6qNasVbmBN7p3aLcl8JjsuxipDeRM6QfuxcBFkkXre f9MVAz+f5rPBwoNL4+aV8oNBgAbrNH3R/07lT2532dlfdojTyAYqt5TOH5v/t1nAOcqL WStNOd1yddCHPwnkeex9VlkCi0hZg+pxMTmMynbV1X4al6fYWSj2iw8zacIUTehI39g8 VCTtpfr5Rsqdcg61MT5VDSwrnimVrX68pU2rNDNPzZ0QAQVrKIB0gTTeEKyNO8SR0JpW VAHQ== X-Received: by 10.202.217.9 with SMTP id q9mr12070568oig.35.1425683046396; Fri, 06 Mar 2015 15:04:06 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.202.58.2 with HTTP; Fri, 6 Mar 2015 15:03:26 -0800 (PST) In-Reply-To: <54F83061.60108@seld.be> References: <54F83061.60108@seld.be> Date: Sat, 7 Mar 2015 08:03:26 +0900 X-Google-Sender-Auth: RFDT7BpT6ALhzTpZwwcuWBE5Jw8 Message-ID: To: Jordi Boggiano Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113cd4008afbc60510a6b32f Subject: Re: [PHP-DEV] Re: [RFC] [DISCUSSION] Consistent Function Names From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a113cd4008afbc60510a6b32f Content-Type: text/plain; charset=UTF-8 Hi Jordi, On Thu, Mar 5, 2015 at 7:30 PM, Jordi Boggiano wrote: > On 05/03/2015 08:07, Yasuo Ohgaki wrote: > >> 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 we do create new array functions I think it should be thought through a > bit more than just cleaning up the arg order. For example we could support > Traversable as well. Then at least it'd bring some value beyond consistency > for the sake of it. I agree. Do you have more detailed suggestion for this? http://ruby-doc.org/core-2.2.0/Array.html https://docs.python.org/3/tutorial/datastructures.html https://docs.python.org/2/library/array.html https://scipy-lectures.github.io/intro/numpy/array_object.html We have a lot of array_u*() functions such as http://php.net/manual/en/function.array-uintersect-uassoc.php array array_uintersect_uassoc ( array $array1 , array $array2 [, array $... ], callable $value_compare_func , callable $key_compare_func ) this can be consolidated to http://php.net/manual/en/function.array-intersect-assoc.php array array_intersect_assoc ( array $array1 , array $array2 [, array $... ] ) All of these has callback the end of parameters. These may be consolidated. I'll add this to the RFC if this is preferred. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a113cd4008afbc60510a6b32f--