Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81059 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 569 invoked from network); 24 Jan 2015 00:01:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jan 2015 00:01:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.51 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.192.51 mail-qg0-f51.google.com Received: from [209.85.192.51] ([209.85.192.51:60245] helo=mail-qg0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E1/31-28190-5E0E2C45 for ; Fri, 23 Jan 2015 19:01:41 -0500 Received: by mail-qg0-f51.google.com with SMTP id z107so257778qgd.10 for ; Fri, 23 Jan 2015 16:01:37 -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=e7vxK0mqXTIPKp4Bg/Po0Me3bHG7LdpWQAca3P3cmGQ=; b=zd6LnQ7bHbZAFs2hAMKGzs9zTIfEVPviUtTP+NowlRs4xdKK1TZMsqgjrd59RIr0sQ Gg6sbxhX37aUoRrttsyaM2lis6eoWNd0g4SksCw+57Oxmx8R8zyqfjfyfY7WswmmaJz7 II7OzwbgMLqukH7UjdrSTE6eiZ1TX4cHiE/gN/p61oN8/VDUnsW8CqredTXFmgGt9q4G JsdYHQ/pxvMDY6RpmmTI4hAZOYwsK93bNN63p3Sv4W/IYlcCvvNxFLy0S9UYYYUDmbqy 3aABXYpEVd4U2unT2VoGot4vmZ0FmcnDnfjv3xaeRAfLJZKOvCLZxgTe4XaCso3uE3ID mLDw== X-Received: by 10.140.20.226 with SMTP id 89mr19093545qgj.43.1422057697765; Fri, 23 Jan 2015 16:01:37 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.93.70 with HTTP; Fri, 23 Jan 2015 16:00:57 -0800 (PST) In-Reply-To: <54C2DC7C.2060806@gmail.com> References: <53F8A1FF-C809-4DDF-9C6F-6916C3E4F044@ajf.me> <3251D635-D97C-4738-B537-935A6CC21E19@ajf.me> <54C17E2B.80708@garfieldtech.com> <8858EE5D-7472-41F7-9C38-091043100ABF@ajf.me> <20150123100248.GQ26114@phcomp.co.uk> <54C2DC7C.2060806@gmail.com> Date: Sat, 24 Jan 2015 09:00:57 +0900 X-Google-Sender-Auth: E_u_d-FiQs2ggnXv0YoN2mgzYZE Message-ID: To: Stanislav Malyshev Cc: Andrea Faulds , Alain Williams , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c1257eecf324050d5a9b26 Subject: Re: [PHP-DEV] [RFC] Combined Comparison (Spaceship) Operator From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c1257eecf324050d5a9b26 Content-Type: text/plain; charset=UTF-8 Hi Stas, On Sat, Jan 24, 2015 at 8:42 AM, Stanislav Malyshev wrote: > > The only reasonable behavior for <==>, <==, >== would be raising > > error/exception if type differs. > > E_RECOVERABLE_ERROR may be used. > > Comparison operators raising exceptions doesn't sound like a very nice > thing to work with. I meant if it's ever implemented. DbC would do the job to prevent/detect illegal comparison and it's much better than catching errors in comparison. IMHO. Type hint is useful for preventing/detecting illegal comparisons also. There are many cases that types are better to be checked always. However, there are many cases that type checks are better to be omitted for production code also. DbC can be use in this case for faster execution while asserting types during development. Anyway, it's off topic. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c1257eecf324050d5a9b26--