Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119382 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 20854 invoked from network); 20 Jan 2023 18:28:46 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Jan 2023 18:28:46 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6225318033A for ; Fri, 20 Jan 2023 10:28:45 -0800 (PST) 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS20857 136.144.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from outbound3.mail.transip.nl (outbound3.mail.transip.nl [136.144.136.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 20 Jan 2023 10:28:44 -0800 (PST) Received: from submission10.mail.transip.nl (unknown [10.103.8.161]) by outbound3.mail.transip.nl (Postfix) with ESMTP id 4Nz7L32Zr0znHy9 for ; Fri, 20 Jan 2023 19:28:43 +0100 (CET) Received: from [IPV6:2a02:a450:3eae:1:94b8:1d71:9606:6737] (2a02-a450-3eae-1-94b8-1d71-9606-6737.fixed6.kpn.net [IPv6:2a02:a450:3eae:1:94b8:1d71:9606:6737]) by submission10.mail.transip.nl (Postfix) with ESMTPA id 4Nz7Kz0rzxz1gwhW for ; Fri, 20 Jan 2023 19:28:39 +0100 (CET) Message-ID: <828f1ec6-e8ff-01b2-dc0e-a6cf1dd16eb2@demon-angel.eu> Date: Fri, 20 Jan 2023 19:28:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: nl To: internals@lists.php.net References: <5FC8DBAF-8D78-4E94-A3B0-3BDED3A3E53C@craigfrancis.co.uk> <789af205-4582-66a9-694a-10e18b8b9f56@demon-angel.eu> <9d225219-4e31-b362-52a9-9a298a0a55ef@telia.com> <768de46c-9ff2-eee2-24ab-e78e27ad167c@demon-angel.eu> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: ClueGetter at submission10.mail.transip.nl DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=transip-a; d=demon-angel.eu; t=1674239319; h=from:subject:to: references:in-reply-to:date:mime-version:content-type; bh=GRezhCyk0zy0CLzrAuWZRG8+IrzDxXEhkh6kDlV+vgM=; b=vyjRZG77lj9pZ9JWaSijO7Hp7utqqytOa+lKPJq7Gfjv0WsAjFVHr46qjauxuOhbvXJN5z ERa88v4KlQQ0Ed5WLMAS1uj1USOUj3EGxXbr6xZrAi3bho/X5z+ru/f4+6wYiA0OqeZRos 33Zp6mFgcTP5g/AXv0fBCf5CuHQwAd8cC63IftP+C8pZmX24F9nScUzlRQRPEBaaO+IoOY h/WWYSeKTJ7PvEhijOfjTkwAgm2wbqeBrFBUJRa3/Oid+cjjsxjf2X7zz1+aKQbT16wXmh hD4FYMWBTLUGSRVnh7SNTSA9myMQRGYayn7kQSzjt88gz/VvZchOOWl+D+wNWQ== X-Report-Abuse-To: abuse@transip.nl Subject: Re: [PHP-DEV] [RFC] Path to Saner Increment/Decrement operators From: mark@demon-angel.eu (Mark Baker) On 20/01/2023 18:43, G. P. B. wrote: > That's a strange hill to die on, most people would expect that those > operators do indeed behave like Add1 and Sub1, and clearly you are not > having any issue with making -- act like Sub1. It isn't so strange, when you consider that an OS library like PhpSpreadsheet with over 100million installs makes extensive use of alpha and numeric increment (not alphanumeric); and I dearly wish that PHP had implemented the decrement operator for alpha strings as well, because that would have allowed me to simplify the codebase even further; so I would prefer if -- acted like a decrement for alpha strings, and not simply as a Sub1 for numerics. The documentation page consistently uses the word Increment and Decrement, not Add 1 and Subtract 1. Developers who read the documentation should be aware of the Perl convention when dealing with alphabetic strings, and should expect that behaviour. Alphanumeric strings are certainly more problematic, less well documented, and less well understood, and I'll agree that they're inconsistent in their behaviour. Deprecating the Increment operator for strings will create extra work for me, will affect many of the users of my library, and I'm certain it will also have a performance impact on the library (replacing that operation with a more expensive function call for alpha increments, but still having the operation for numeric increments). So yes, I am willing to die on this hill because that deprecation will have a very direct and adverse affect on my work. -- Mark Baker