Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83761 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90590 invoked from network); 25 Feb 2015 10:32:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Feb 2015 10:32:03 -0000 Authentication-Results: pb1.pair.com smtp.mail=lisachenko.it@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=lisachenko.it@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.171 as permitted sender) X-PHP-List-Original-Sender: lisachenko.it@gmail.com X-Host-Fingerprint: 74.125.82.171 mail-we0-f171.google.com Received: from [74.125.82.171] ([74.125.82.171:46047] helo=mail-we0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B9/B5-62407-1A4ADE45 for ; Wed, 25 Feb 2015 05:32:03 -0500 Received: by wesp10 with SMTP id p10so489685wes.12 for ; Wed, 25 Feb 2015 02:31:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ogYMefRwd0FdoKsfslVExuhugG5gsw0oOm+CwQoHwTs=; b=iXlzstnweZrsbuD6E31Xlrgoaxi0foykpZB/DZE97KlVmgvnAlwadEGRwthJpb811t qcqBfm/Y+cdmqA4wU87EcH5cAYP44cJHl1gJnxPIVv/Yb0tf6B0VRhnneXCFzVzYSPjh 2STS9f9nDsWKy8WC2GvtYeCdp1vJwr/KB5R5giVNsd+TeMfWmdaCSj1m4QSQRpUrdZ6Z C07rdh6uEL3LxKvMyKG+aSr/1EBeC9VoohiiMUYpN89cLCzblW5R40YBeJ9B9BxuBKwo MV9Im7NJeA14+zmlL0d6yIHHg4WOkwjalCKTjIKr5yqr8/kKqXRn+WmbM3xI4T16+a2b VBSg== MIME-Version: 1.0 X-Received: by 10.180.9.71 with SMTP id x7mr5472185wia.0.1424860318135; Wed, 25 Feb 2015 02:31:58 -0800 (PST) Received: by 10.194.154.229 with HTTP; Wed, 25 Feb 2015 02:31:58 -0800 (PST) In-Reply-To: References: Date: Wed, 25 Feb 2015 13:31:58 +0300 Message-ID: To: Thomas Gielfeldt Cc: Benjamin Eberlei , PHP Internals Content-Type: multipart/alternative; boundary=001a11c247641df913050fe72585 Subject: Re: [PHP-DEV] Feature request and RFC From: lisachenko.it@gmail.com (Alexander Lisachenko) --001a11c247641df913050fe72585 Content-Type: text/plain; charset=UTF-8 2015-02-25 13:21 GMT+03:00 Thomas Gielfeldt : > I have some more proposals for how to implement this interface. Should we > create an RFC for purposes of discussion, or do you usually do this in the > mailing lists? > Best interface is described by the one single method: sort() that accepts optional flags and callback function: So, interface Sortable { const ASC = 1; const DESC = 2; const SORT_REGULAR = 4; const SORT_NUMERIC = 8; // more consts here... public function sort($flags = 0, callable $callback = null); } Callback will accept key and value pair. --001a11c247641df913050fe72585--