Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96124 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74670 invoked from network); 23 Sep 2016 22:14:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2016 22:14:41 -0000 Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.213.45 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.213.45 mail-vk0-f45.google.com Received: from [209.85.213.45] ([209.85.213.45:36562] helo=mail-vk0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9D/84-51000-059A5E75 for ; Fri, 23 Sep 2016 18:14:41 -0400 Received: by mail-vk0-f45.google.com with SMTP id d8so3032114vka.3 for ; Fri, 23 Sep 2016 15:14:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6x5u4BrIZmlCcZHeQOlVFqE0inXRopNsWCKjm8RHxPU=; b=Ai39uAAP7yHBpn0jDXpkggrRHNeEmB3Ab5tvF9Qk3WGE2EK/kN9ScKhiEs7Cj9vk5q RVqBRCfHmGBLnJubLy5ZytLKoFldWQsfFh6WcyzXjVsKmQfPBAUgoMcKm/MWo/uzjwwd 0jsFUEfqx+RnDdgt0ufj+wRksEuc/QckSOem9HO0M3dKHViegAy0oRKcbc2ZRO3niA7r N7NGbzzAhjRmQEIwZ99PDhllVhZTE3itGumYhF+J6D/0DY4tZ8tlhmglvblLCaG028vc OLrnADLLgGnnKGPKOr+tCrRMkuUXOcKyZl3ljteiY9DynMYmFOGizn4azjdyB/eGx0Zs ix1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6x5u4BrIZmlCcZHeQOlVFqE0inXRopNsWCKjm8RHxPU=; b=hNSXkO7odVDht6PtZ50kdy278VRhC6VLZjEOZpWafadKEdgSIOB/UrURb04Hj68PPC /mngrXSuWhtSICkhSojq7iM3zF1tJDJvQS/5UcCbUsccTCJFWD8gF0JiWjTqlpsFFri9 qQjC7os43ucRHgRDlatwJidj4KMq9fOn99TKSAPISovUUFBK03wojBKLXSOVbfo+LGfp 5x7E9rDmwol19AqZLyTGKtIQd/bPMFmWlLzVkAwGNZcSOsRxiGjzyqOZdYamahuL5llK RFX4OyYn+Paky3TjTHLMXuzF4BM4UNJtegu8Tb0xK/j2KH/U29OGlQGGNmKLj7PVKuWC 5z/A== X-Gm-Message-State: AA6/9RlbriLOFd4/GCcbe5CtuDYFSaiDML2PqjkkmYn6c3X4rRLxIgx/7oeVf2KLbZ7l3XAE1a2EWBMG9Wm+tQ== X-Received: by 10.31.58.77 with SMTP id h74mr492912vka.15.1474668878354; Fri, 23 Sep 2016 15:14:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.69.4 with HTTP; Fri, 23 Sep 2016 15:14:37 -0700 (PDT) X-Originating-IP: [2.99.239.160] In-Reply-To: <69f23a7d-3fda-3390-d5e3-a9101b8c7045@gmail.com> References: <9F330826-CF44-4584-961B-727EEDD9482A@cschneid.com> <50921841-5F6D-4EB6-9E94-8D32FA05C86F@koalephant.com> <69f23a7d-3fda-3390-d5e3-a9101b8c7045@gmail.com> Date: Fri, 23 Sep 2016 23:14:37 +0100 Message-ID: To: Rowan Collins Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] RFC: Strict comparisons From: danack@basereality.com (Dan Ackroyd) On 23 September 2016 at 17:40, Rowan Collins wrote: > > I've been pondering an idea for ages of a generalised syntax for switch to > specify an operator to use, so you'd do something like this: That's technically possible already: function foobar($foo) { switch (true) { case $foo === '1': echo "close but no cigar\n"; break; case $foo === 1: echo "identical\n"; break; case $foo == 1: echo "why you do this\n"; break; } } foobar(1); foobar("1 apple"); It's just a little bit icky. cheers Dan