Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106065 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 15946 invoked from network); 26 Jun 2019 10:40:21 -0000 Received: from unknown (HELO mail-ed1-f46.google.com) (209.85.208.46) by pb1.pair.com with SMTP; 26 Jun 2019 10:40:21 -0000 Received: by mail-ed1-f46.google.com with SMTP id k21so1922472edq.3 for ; Wed, 26 Jun 2019 00:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=7HISnCyuUjzqVVBplGc98n9yg7E9BqsCdBm4pjiYnGY=; b=XNX1WS1VNXExhPjE0nUCHDP6Jxh0Yztsi7OX+KKCsJ77ez3DUbqRxhBoUTrKjv/6jk ocLpUA0oY13H+sZUY3TjyIEgtaP0Q2sSZl7K/xMpXIZ7N17UF+KsX80f8ju1DktasvJC BgcsCRAJwpKRzNVHuG6f9i4OXAsk3OJvv+FKFI3AZJP+cQitme54yzLncnw6VZAaPTCs CuNjgYDUXKpfSkEpqUe3Dw9l663ZHEVx+q008DefUhD5OBwnCJamNpKSDyKhGrcRnB0z am68SVg/SmYZm7mqosoNb3alSD9u8EC0sPaato6LMdYzYMOUyBf6LEFJzFLvqiWdOOVx KMPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=7HISnCyuUjzqVVBplGc98n9yg7E9BqsCdBm4pjiYnGY=; b=kOQK2nMOX/0ZkRC/HVEo0JgFvkV62371EAvMnLkc+k/hyKLJb4/KF4eGOF6+HNDQJF 54TtcTNd3g4IRwumE9sS0G265v6izW3VRvCzxZZEVXdDzauR6S3xt2f2VrNRB141na6n h6f6VOscJPL6U48F5+HHIyyYw3734AJdF2JbBeMEG07vH2YpiKJzjAicFFA9yBzgl3Jn uHdgV6Eg5AmYaisBCfX8mGIckWQJbzrVOj6KVM1eJtfzsjhU07eHeuYWwq4wVtIP6XEZ 9OjgKIaHbd+6dMJKY3dy78hNuwpVwoScp7UPi+PfUgyqhmVl2F2BG0XsKrP9w6ixY7E2 CU8g== X-Gm-Message-State: APjAAAVLAXi18aT6VhLA9anyGMDlRlZM+B8IiNtwEw57Sq9ccksOi8IV TqsWqwMZRvOTViYJmyqzzc6QimAUZsw= X-Google-Smtp-Source: APXvYqzvryCsb08A8xUdrvNP3h+7lc67kVD4T+HLyViYQDGyFx0aob8VeTCcO1wqyKKVhvBJx9xu1A== X-Received: by 2002:a17:906:8386:: with SMTP id p6mr2696411ejx.139.1561535801930; Wed, 26 Jun 2019 00:56:41 -0700 (PDT) Received: from [192.168.0.63] (84-75-30-51.dclient.hispeed.ch. [84.75.30.51]) by smtp.gmail.com with ESMTPSA id y4sm5543870edb.64.2019.06.26.00.56.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jun 2019 00:56:41 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) X-Priority: 3 In-Reply-To: <6D1026FF-ECF1-4604-91A8-D290D37CC238@cschneid.com> Date: Wed, 26 Jun 2019 09:56:39 +0200 Cc: Arnold Daniels , internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <6D1026FF-ECF1-4604-91A8-D290D37CC238@cschneid.com> To: Christian Schneider X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] [RFC] Strict operators directive From: claude.pache@gmail.com (Claude Pache) > Le 26 juin 2019 =C3=A0 08:50, Christian Schneider = a =C3=A9crit : >=20 > Am 25.06.2019 um 15:09 schrieb Arnold Daniels = : >> This RFC proposes a new directive 'strict_operators'. When enabled, = operators may cast operands to the expected type, but must comply to; >>=20 >> * Typecasting is not based on the type of the other operand >>=20 >> * Typecasting is not based on the value of any of the operands >> * Operators will throw a TypeError for unsupported types >=20 > While I understand that some people don't like the way PHP does type = conversions I think this proposal creates a much bigger element of = surprise when copying PHP code from one place to another than all the = .ini-settings ever did. >=20 > It basically creates two languages in one and I won't be able to = determine what > $a =3D=3D 42 > exactly does without having to look at the header of the file. >=20 > I'm inclined to say that if you want to make PHP a new language with a = new core type concept then you should fork it and call it something else = to avoid confusion. >=20 > - Chris >=20 Indeed. The directive may make operators more strict in what they = accept, but it should avoid changing the semantics. Concretely, we must = have either: "120" > "99.9"; // true or: "120" > "99.9"; // TypeError Anything else will bring confusion. =E2=80=94Claude