Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114859 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 39880 invoked from network); 14 Jun 2021 12:50:11 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Jun 2021 12:50:11 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1BABF1804D1 for ; Mon, 14 Jun 2021 06:06:24 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-vk1-f175.google.com (mail-vk1-f175.google.com [209.85.221.175]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 14 Jun 2021 06:06:23 -0700 (PDT) Received: by mail-vk1-f175.google.com with SMTP id 12so1413205vkk.5 for ; Mon, 14 Jun 2021 06:06:23 -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=neScq2hQQXeQfZH9ZIMAk2VXqOGZjMx0UyajdigWc7s=; b=D6K2QexFIaIn8vlDHTe36dsc8muHJRCHjAnQ8hylV4rN9C5tKI5LpUlhP+DM8z9IxP /fXilQ5Uh4xB5vM+JL4vM3FnM83QweBZGHOybk321opocA5xRD/6/xocjc3172bxBOXX P/9kulWaTPqE0r6GtCbQRF44L2panNxqyTMWZlCzZHn2TI7sKY0PhTkfhJl9s0caZ0uE MJ72YPWp3knAJb6dqa96+YhGwCp6WtpNKKk+Fcan1jS9NAbZn9oB7DWsc+WDivLlj67V RQbds1HsBhCcmd1StwzqeTg/z+lroamSDPO2/dCT56iTqAdMls8o9NqNYpt9AKKC5Tmz c7cg== 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=neScq2hQQXeQfZH9ZIMAk2VXqOGZjMx0UyajdigWc7s=; b=g/cywTaaauBLBvXOiA8klG4txRBt2hJA4X5kZ3zE44Lnb1BbobL0WCQ3Ph+46aL8Uc xVpQaCDXmE7vm3lwpuPD+XpROmZRflAdXteJ1vfrvEwTraNGpSOpgy6QZxfImYJpgAvE kBjxYkRq/2WENLZX3K9DYgfbIsXSHiWV5/aWKNlZ25zIJ/vuzY87B4WGBqIpGjA7ezWR w3P775x9s+tZjSPLFobC6XhQd0bKN8y9bSa8sY7vvPGMYVhgMVlqi4hxXNXpCWmmSKeK ZIs2/NdqHw1SSJ30549PMQXRIwpesoA9kk/JQXtuldtn9BAZXar/Fe2KwWAKS/08qic8 8ZrQ== X-Gm-Message-State: AOAM532eyddSHNjTKHevbO6bhHTk+j7cqGXmeKG3en7dO++BvZChX1D5 alm1hkqxcI1xwbhuLI2IAk8taFrGKZeI7b2Cx/4= X-Google-Smtp-Source: ABdhPJwchvYTMBMYQYGRO5O6Vlyp9jKtufHmKZo/+RbEEDz2FVezGs9doPOjFqzJRRYVWcqnNw4J91eCgA1MMSW/uj8= X-Received: by 2002:ac5:c2d6:: with SMTP id i22mr2568074vkk.16.1623675979650; Mon, 14 Jun 2021 06:06:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 14 Jun 2021 09:06:08 -0400 Message-ID: To: Dan Ackroyd Cc: Joe Watkins , Craig Francis , PHP internals Content-Type: multipart/alternative; boundary="000000000000ff5dca05c4b98555" Subject: Re: [PHP-DEV] [RFC] is_literal From: matthewmatthew@gmail.com (Matthew Brown) --000000000000ff5dca05c4b98555 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 14 Jun 2021 at 08:30, Dan Ackroyd wrote: > Hi Craig, Joe, > > While I think the idea behind this RFC is great, the current > implementation is terrible, as it will cause some fatal errors in > production. > > I'm not sure it's productive to call the implementation terrible. With Someniatko's suggestion of a literal-string type, that issue (like so many others) could be caught by a type-checker: /** @return literal-string */ function getColor(): string { return $_GET["color"]; // this would trigger a typechecker error } In fact I think there's a solid case for adding support for literal-string to type checkers like mine today =E2=80=94 mainly to prevent patterns that = might later lead to SQL injection. --000000000000ff5dca05c4b98555--