Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96722 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60391 invoked from network); 3 Nov 2016 16:03:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Nov 2016 16:03:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=bishop.bettini@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bishop.bettini@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.171 as permitted sender) X-PHP-List-Original-Sender: bishop.bettini@gmail.com X-Host-Fingerprint: 209.85.217.171 mail-ua0-f171.google.com Received: from [209.85.217.171] ([209.85.217.171:33716] helo=mail-ua0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 26/3D-34238-ACF5B185 for ; Thu, 03 Nov 2016 11:03:24 -0500 Received: by mail-ua0-f171.google.com with SMTP id 20so43213320uak.0 for ; Thu, 03 Nov 2016 09:03:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:from:date :message-id:subject:to:cc; bh=OJyCTUIoUXpAADMMtzKJNpFXEMlwoORfAUlaVQzZVyA=; b=ftqKkK30e6uguzlvUL3AioOUt6BzSykUNPt6wa5jox05y5PzpWatgtS58UkI4i5lQ9 OBhZi5IBhDNs1Sz6OuZhL+XDmqxYcp9AhmrFORAQz/I9tYloyFGiWld8/oFIEYz4T1Db STI7j7jjjXJWKmQQtkXg5NpBvEF07UROoM3+ubKcOlE4glzA0UVwzq+jvSIUskVzdkht 552bP+jHykcksmwRCS+p7zuxVWlU+IKP+OIEpp1tJJS+2M9b3LLj3kukDn3xY0PZDCqv R/tcVuHFAxblzVQZ/87A+J2s/IcRKkRTrvxXa79plSC/X8yJUdDaN/wwiQVbPC+rR4Rg 3H7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:sender:in-reply-to :references:from:date:message-id:subject:to:cc; bh=OJyCTUIoUXpAADMMtzKJNpFXEMlwoORfAUlaVQzZVyA=; b=YiUZq/ou3D2ft3BRddRlLSBillXQKChc1D+6UlQUjmcSZx6M+Y7s3xdGMy623wyWCW THzbb+ABVM6+jbhTzIzwloaDqkv1YX9ZjuLpyVt5V1h5AI82Q6D9knkwGCrPGllP3RP4 P85cYDVR3Iqn0VCXVQRAejrC70NXf/QPSuvmJGGw36c7X1D4Dodvn9DCw5HYk6duE9BB rLjJLd9ao4SLZQgGGyjKcC2JsDi6CokgbaRMGlliUUT+iFWT8ezpKnovtV6Y0JGaLWEb MAn3xYioAIFYRHstO2BTGqK4B3wgqCUac/eyouUZ4UgXUME7f/x+lS4/VQb6WdEtZYvF 9Jlw== X-Gm-Message-State: ABUngvdcBW2AKQ0LQAJ0VqqbnzQsmMu4x5QEwzqwGBigBEhdYY9Vug5gpGBC6LGH+EoBkKT0ZkgHg1XUsxJT9A== X-Received: by 10.176.0.147 with SMTP id 19mr5485454uaj.20.1478188999718; Thu, 03 Nov 2016 09:03:19 -0700 (PDT) MIME-Version: 1.0 Reply-To: bishop@php.net Sender: bishop.bettini@gmail.com Received: by 10.103.123.5 with HTTP; Thu, 3 Nov 2016 09:02:49 -0700 (PDT) In-Reply-To: References: Date: Thu, 3 Nov 2016 12:02:49 -0400 X-Google-Sender-Auth: iKba6cL7UR_d2rsWxKc5SO4dK6E Message-ID: To: "Antony D'Andrea" Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113dda603d3e05054067b207 Subject: Re: [PHP-DEV] Proposed RFC From: bishop@php.net (Bishop Bettini) --001a113dda603d3e05054067b207 Content-Type: text/plain; charset=UTF-8 On Thu, Nov 3, 2016 at 11:02 AM, Antony D'Andrea < contactme@antonydandrea.com> wrote: > > I would like to propose a new feature that is as clean as this but is a > slightly different use case. This would require a new operator (up for > discussion, but an early idea is "?!") For example: > > echo (!is_infinite($n1/$n2)?!0); > > Would output ($n1/$n2) if it is "true" and 0 if false. > Welcome! Let me read back what I'm hearing. If the predicate returns truthy, you want to return the argument to the predicate, otherwise the indicated default? How would this be used outside predicates, such as on string functions? Consider: echo strpos('abc', 'b') ?! 0; What would this output, and what would the purpose of such a construct be? --001a113dda603d3e05054067b207--