Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106055 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 65116 invoked from network); 25 Jun 2019 20:40:24 -0000 Received: from unknown (HELO mail-lf1-f42.google.com) (209.85.167.42) by pb1.pair.com with SMTP; 25 Jun 2019 20:40:24 -0000 Received: by mail-lf1-f42.google.com with SMTP id a25so13304325lfg.2 for ; Tue, 25 Jun 2019 10:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gR/ENRHBk2PZSLax0x/2hKYGHK5xkzAuZdC5UeM3s9c=; b=DUr7v/KGtXDXA9IlH3GPJvl0DkvqgvseTYx+yML6dI4CM5VUPYvQhKcjkyIu4PBvce KURB2cQfrNgITmc/QxqtXbSJCwz/omwPD20Ip6pvHapMFMCiC2JLKhOlFDlkQBSONR4Z xDa+IlkVIwm/S8xfi9EddZjJa9iL7h6UaI3ZVtjW4+MJtCdsBDatBfS60TvmPkXe2RR8 lv7XoQ6QcczdI9yecAMMd6/eMhHjV/gldFsTjZuOw5uS8jPM2HlAfohJ1k8gsSFiP/Cm wJWiW9S4ntI1qPJWIpdzOz5Up+i/8pTl2PqNOQ6CEPEvF6+ikd3EKV6TmJ9gp46t2Ziq 2q8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gR/ENRHBk2PZSLax0x/2hKYGHK5xkzAuZdC5UeM3s9c=; b=Fq6CwxQkt2YUaPTIYz4A5ygN1Ya19Hmk/DswD5Pt55ANtjkyQy8jjL5wNJN0R1rVbc MNZvsZkNkc7n/MMy7fVpqzwHhCV5WRHXT1CjHb5ISEYjna/cV4jGq0om0orxK6nwEfOm IrTQBXnPasvDBpn4io76BjiB1lMgh0HjqbaLp7KZNRpL1D3R3rJrROpJxWitNX5Dnnf9 0sgcJL79m8rW/fSjOnwev6dxAgYRj2sGWhrUnd/z/7cKfos/MdlJIQ4Bniwivz8fk8wi GTwFx51t/VOyEDP6tA3vHNg5IWWsAQHd4nu2ebE/FWupvgXEU5b+5w61UQgR+25Ymn0i Tvsw== X-Gm-Message-State: APjAAAWwVBe9PilocfSkdTz48R6f1xxOA/KVM/uyuYdTqXp1dV29t1RU JFwqqJm3OnvOWrgbZVynnObX2hpU0uwozWQRsw== X-Google-Smtp-Source: APXvYqz0s0lCXRCoZBDYuOuwhnkWzFMySPWozM/NJxY6GrzTSfwXvD+PctT6BHFp64XR0geXCVBXU4/SD461F2O/lL0= X-Received: by 2002:a19:5046:: with SMTP id z6mr10728lfj.185.1561485396303; Tue, 25 Jun 2019 10:56:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 25 Jun 2019 19:56:27 +0200 Message-ID: To: Arnold Daniels Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Strict operators directive From: guilliam.xavier@gmail.com (Guilliam Xavier) On Tue, Jun 25, 2019 at 3:09 PM Arnold Daniels wrote: > > Hi all, > > I would like to open the discussion for RFC: "Strict operators directive". > > This RFC proposes a new directive 'strict_operators'. When enabled, operators may cast operands to the expected type, but must comply to; > > * Typecasting is not based on the type of the other operand > > * Typecasting is not based on the value of any of the operands > * Operators will throw a TypeError for unsupported types > > Reasoning; The current rules for type casting done by operators are inconsistent and complex, which can lead to surprising results where a statement seemingly contradicts itself. > > Using a directive means that backwards compatibility is guaranteed. > > https://wiki.php.net/rfc/strict_operators > > Yours, > Arnold Daniels > > [Arnold Daniels - Chat @ Spike](https://www.spikenow.com/?ref=spike-organic-signature&_ts=1mzl6) [1mzl6] Hello, thanks for the impressive work... I have just one interrogation: why disallow `~` for strings? (e.g. currently `~"\x00\x01\x02"` gives `"\xFF\xFE\xFD"`) -- Guilliam Xavier