Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125213 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id B01EA1A00BD for ; Sun, 25 Aug 2024 14:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1724598010; bh=JFSq1s/lVdmMOkkjOElDoTeHQ+Alv/q+9NIeqOTXNFI=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=mHrD8uJLNFGF3/dnKwqZeJFxHyfJry3ba/7aKQM7RraX1YQjXSJVmtURKwEPNCqD1 /Ue7pbWTIi4EUZgUT2Tib398vJVUtccbmO5wtRwzmyNcDZl2UE4Qruc2QL+GrM2wnt zAkMo9/zqhNkFtdTjT6sdd0Ww5MnM3WajjPyJH4V3AEs3ec5uf9UY6TEmgeHAOXi7Z OaGAzBaWRObgGrturHvXnLqVW2ovrgPYYZ+/CeaHc91DknHm6GvBmsE/cg7Vbmh7Pf hfJxdXZaGk6ZrP5DkUycRu4dy3YlgPRz9F7kI9T34Fb1Dk8lIA/Sn1G7Vdoq8vFYXO AVqafxfCD2mRA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0811E18007E for ; Sun, 25 Aug 2024 15:00:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: **** X-Spam-Status: No, score=4.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,RCVD_IN_SBL_CSS,SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com [209.85.219.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 25 Aug 2024 15:00:09 +0000 (UTC) Received: by mail-yb1-f176.google.com with SMTP id 3f1490d57ef6-e164caa76e4so3115385276.1 for ; Sun, 25 Aug 2024 07:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=coggenterprises-com.20230601.gappssmtp.com; s=20230601; t=1724597896; x=1725202696; darn=lists.php.net; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=JFSq1s/lVdmMOkkjOElDoTeHQ+Alv/q+9NIeqOTXNFI=; b=QOmjKq1JLYZn/l5ZEkhIBqK7+VQC8VVOHq7BKwXbr/6jy/964Mq9MZt+1YDk93cSll MRi/K59AIFcMWWl/qF7/WRXoOjwb7LAnhp7yt8T9DhcML56eefNKLZLefPyBrn5lLBYj jcGEsUB6Y/+yCOAu1mbdcmV/UJm5ICT6NdncjnjFkuMuA9o1PoVxANBZ9q8B3yXpAi6y H4Mzl1swcv5uQKsigpCbajWF3MPbFPcx5MyuYFDwPY92wy59jrHzNbgSx4doDRkNiPS4 pmhBCI8zFe2nwpZtmaxjKAbHJVyOSZ4ZiZ9uEWhZn7MC2xYdDW8N+hK7mSL8OKoJ38cS 8tmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724597896; x=1725202696; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JFSq1s/lVdmMOkkjOElDoTeHQ+Alv/q+9NIeqOTXNFI=; b=sP/ItAofIm2Gfxq6gg+gzIXqCQsKeGZZrDExpiox65ojMrMH9XRYP35efuy5ST4YIb mqoJQ2fOLz1Ra1aiSR+0NH39GNlUHD5O9UWo19CoiC5rfLGzJM1cC9vngJaxJCxmPCL/ VkNcln9kHUJ940rn5I8oz21ZMRG2597Oo3/zTDA90XOf+wH/i9YvNlgniyAFMTSLmhWv 0xh5O7Q7KfuV1hA4ymxQ5v6nrEsYJenhf0/zC34xnYwlvxo68ZRdCec4IKtXfEnXYht8 C0a/JO5u4zSyRW/NjRWKnyFol9ylnB/A3lqeBHTBRo4cjB/ohXe7MFtUKeW85RIvFI+R E8qA== X-Forwarded-Encrypted: i=1; AJvYcCV5S2dJayG4Q8wWGYMEbyrw8W2ffjuU+EyCREMXkrERn0J+f5/buZt3JZR0EqPgqN3qikFnCY5QStY=@lists.php.net X-Gm-Message-State: AOJu0Yyjba0VKFiE7dWGzNM/bt3Ne3Rez2gToMm5w0lTFajao7lLt08P a512rC5cLmGZ0/+ghzl/dOWBkfMMuW7nRL9TLRrhXoYY/8l+Fgxw4ouBTeA3/1HWySQe4TffRXe G X-Google-Smtp-Source: AGHT+IGynk0Ev/Bo6EngNP8OG3MO4QQ8DN3eOVK/6JpNfsZ4bbretPxjwJQp/lFjxpg+jyH/6Nusrw== X-Received: by 2002:a05:690c:2b03:b0:64b:5cc7:bcbc with SMTP id 00721157ae682-6c628a9f216mr64356687b3.32.1724597896266; Sun, 25 Aug 2024 07:58:16 -0700 (PDT) Received: from Johns-MacBook-Pro-2.local ([207.213.210.67]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6c399cb4f42sm12082497b3.22.2024.08.25.07.58.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Aug 2024 07:58:15 -0700 (PDT) Date: Sun, 25 Aug 2024 10:58:14 -0400 To: Matthew Weier O'Phinney Cc: Bilge , PHP Developers Mailing List Message-ID: <1DA8A427-85EA-449B-97AC-314958E8D49F@getmailspring.com> In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC] Default expression X-Mailer: Mailspring Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="66cb4686_327b23c6_11f93" From: john@coggeshall.org (John Coggeshall) --66cb4686_327b23c6_11f93 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline > If the underlying API changes the argument type, consumers will have an issue regardless. For those cases where the expression is simply `default`, you'd actually be protected from the API change, which is a net benefit already. > > This also protects the user from changes in the argument names. As I said, I don't have a particular problem with default as a keyword to express "whatever the default value might be in the function declaration", but I do have some real concerns about its use as an operand in an expression. The RFC provides for a single valid use case of operators (i.e. things like default | JSON_PRETTY_PRINT ), yet calls for a huge array of valid operations, many of which the RFC itself notes don't make much / any sense. I'd personally like to see this RFC dramatically reduce the scope of operations supported with default as an operand initially (e.g. perhaps only bitwise ops), and revisit additional operations as needed down the road. IMO there is a very small subset of all PHP operators that make any sense at all in this context, and even fewer that I think are a good idea to allow even if they might make some sort of sense. --66cb4686_327b23c6_11f93 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline

If the underlying API changes the argument = type, consumers will have an issue regardless. =46or those cases where th= e expression is simply =60default=60, you'd actually be protected from th= e API change, which is a net benefit already. 

<= div>This also protects the user from changes in the argument names. =

As I said, I don't have a particul= ar problem with default  as a keyword to express =22wha= tever the default value might be in the function declaration=22, but I do= have some real concerns about its use as an operand in an expression. Th= e R=46C provides for a single valid use case of operators (i.e. things li= ke default =7C JSON=5FPRETTY=5FPRINT ), yet calls for a= huge array of valid operations,  many of which the R=46C itself not= es don't make much / any sense. I'd personally like to see this R=46C dra= matically reduce the scope of operations supported with default  as an operand initially (e.g. perhaps only bitwise ops), and re= visit additional operations as needed down the road. IMO there is a very = small subset of all PHP operators that make any sense at all in this cont= ext, and even fewer that I think are a good idea to allow even if they mi= ght make some sort of sense.

--66cb4686_327b23c6_11f93--