Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72302 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89919 invoked from network); 5 Feb 2014 22:22:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2014 22:22:32 -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.215.47 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.47 mail-la0-f47.google.com Received: from [209.85.215.47] ([209.85.215.47:56720] helo=mail-la0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A2/4A-38005-6A9B2F25 for ; Wed, 05 Feb 2014 17:22:31 -0500 Received: by mail-la0-f47.google.com with SMTP id hr17so835677lab.20 for ; Wed, 05 Feb 2014 14:22:27 -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:content-type; bh=iAz1O74UkBrFCltayz6GSGlE/cwj8I9dnfJYX3i+kok=; b=ByMePY+4GWE6giFGXEwPpK7Q/5trgmDwR1pKD8Ot7cDqKL1Q9LyHXRttojsMBLdmCA StPv2MN4TGU3zik0WXZE6WwPxayam4QOFxKirKgURw3xPbi3nnU75polVAwm3hFxzeSe olnGkrXpkHbQZVRYqIR2R4NKEk65a6CWb9ogikPTsZm7C6SLPoxpQzPVwOl8uiV5g4FS yKNY2FFhZu8mQ2oZrGMwAnBXADTPxDkCiT/UdpM9HRJLu8xoIeBaz8Ez7Iu2mk3Y5axw DX4E9NwWaFSX6ArgwJIsmSTs4aedvJkxnBSiBvm0nSly1bUQjYXdkLYD0hLvzjRlTNQE 5h6Q== X-Received: by 10.152.164.166 with SMTP id yr6mr2686851lab.1.1391638947452; Wed, 05 Feb 2014 14:22:27 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Wed, 5 Feb 2014 14:21:47 -0800 (PST) In-Reply-To: References: <52EE2B66.4040005@pthreads.org> <52F157BE.3020804@ajf.me> <52F15FD6.7060901@ajf.me> <52F1E58F.3050105@sugarcrm.com> <52F1EF12.2050705@sugarcrm.com> <52F1F675.2000600@sugarcrm.com> <52F20D8B.9000003@gmail.com> Date: Thu, 6 Feb 2014 07:21:47 +0900 X-Google-Sender-Auth: EbHYTP835BbCg-AJAXRWTs0xlcQ Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11349a021e5d8c04f1b03145 Subject: Re: [PHP-DEV] RE: RFC: expectations/assertions From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11349a021e5d8c04f1b03145 Content-Type: text/plain; charset=UTF-8 Hi all, Sorry for multiple posts. On Thu, Feb 6, 2014 at 6:17 AM, Yasuo Ohgaki wrote: > On Thu, Feb 6, 2014 at 6:10 AM, Yasuo Ohgaki wrote: > >> On Thu, Feb 6, 2014 at 5:49 AM, Yasuo Ohgaki wrote: >> >>> I agree, some thing like this is needed to call closure or pass >>> arguments to assert() then call. >> >> >> If we allow to pass arguments, it would be something like >> >> assert( >> function($arg1, $arg2) { >> return $arg1 > $arg2; >> }, >> 'Do not pass bad value', >> [$arg1, $arg2] >> ) >> > > Since we don't have 3 parameters signature for assert() now > > assert( > [$arg1, $arg2], > function($arg1, $arg2) { > return $arg1 > $arg2; > }, > 'Do not pass bad value' > ); > > is possible. Could we have this? > Or another function for callback? assert_callback(array $args, callable $callback [, string $description]); assert_callback( [$arg1, $arg2], function($arg1, $arg2) { return $arg1 > $arg2; } ); It seems this is cleanest among feasible options. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11349a021e5d8c04f1b03145--