Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119295 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 68402 invoked from network); 17 Jan 2023 16:28:36 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jan 2023 16:28:36 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BF6D31804B0 for ; Tue, 17 Jan 2023 08:28:35 -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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 17 Jan 2023 08:28:35 -0800 (PST) Received: by mail-wm1-f42.google.com with SMTP id l41-20020a05600c1d2900b003daf986faaeso5000112wms.3 for ; Tue, 17 Jan 2023 08:28:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=craigfrancis.co.uk; s=default; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZGSx0BUURhdy/pbTDTeYtUOZOnr5hUtKqwlaQnPEQpk=; b=AK/eamomQPNQyYjQqwZJ9p7M8HP3CHhE3KZLSsH5en63K+6s7Je82ZLBSNNPovca7Q 1bkAhzObD3DqBQzj/lgjRVsjRVPX/qlujWpSgJUjmHYzTsN6VoXemxsExQyWczA+kOX1 8z0CkbODhinBsGPTRYNwwrEz/tN+9pNkAQuBc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZGSx0BUURhdy/pbTDTeYtUOZOnr5hUtKqwlaQnPEQpk=; b=ZzLhPWW0ZXP7XfdhXyfhpSomgoQprEx8NfHehCxiDKtdBzNqC5ReJitjoZu03HpDvc YjFoTD4XDQlTZpf+3E8iKiR60W4r2ITm4lRzJr0G14AeCjO2vIXSzq4Ofc2wOVqrCesd 2IQ2y00huaqlgJmRh9IiWfxyR7JGxAH1A7nQuqZGh/UtoO2SS4lbbfJP0BFAyR6+lOVn XYwnp30CVcuf1lFmmwzyuV+qk+FkcV/cZZc22PEkhqqXS7FnpiVxF89aD3LpUVeN1RSe o1aqPT/j/Ma3vr1ieWuDDlko2na/raKr0rpWlWpuRHlDXBD5ahzQA9c3fDeOuzzDqD02 mReA== X-Gm-Message-State: AFqh2koECFnn8rYugWYB4LNmziqhphajydIksQ6MghHYlMD4tswpQir9 U0xze5+qWsn81OS2lJAnAB3ooQ== X-Google-Smtp-Source: AMrXdXttt9afMp6HSDW/TxKbhjf+8WbYzSy4p9Tv8SyVNP5eZDBhiG16uXemPQuGgkJCpLLC6vOLcw== X-Received: by 2002:a05:600c:b90:b0:3d8:e0d3:ee24 with SMTP id fl16-20020a05600c0b9000b003d8e0d3ee24mr3790361wmb.37.1673972914087; Tue, 17 Jan 2023 08:28:34 -0800 (PST) Received: from smtpclient.apple ([92.234.79.97]) by smtp.gmail.com with ESMTPSA id iv14-20020a05600c548e00b003b47b80cec3sm48132565wmb.42.2023.01.17.08.28.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jan 2023 08:28:33 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) In-Reply-To: Date: Tue, 17 Jan 2023 16:28:31 +0000 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <5FC8DBAF-8D78-4E94-A3B0-3BDED3A3E53C@craigfrancis.co.uk> References: To: "G. P. B." X-Mailer: Apple Mail (2.3696.120.41.1.1) Subject: Re: [PHP-DEV] [RFC] Path to Saner Increment/Decrement operators From: craig@craigfrancis.co.uk (Craig Francis) On 17 Jan 2023, at 14:28, G. P. B. wrote: > https://wiki.php.net/rfc/saner-inc-dec-operators >=20 > The goal of this RFC is to reduce language complexity by making $v++ = behave > like $v +=3D 1 and $v-- behave like $v -=3D 1; >=20 > I am expecting the contentious part of the proposal to be the = deprecation > of the PERL string increment feature to achieve the aforementioned = goal. Hi George, Just to confirm, you're suggesting the following would be broken: ``` $ref =3D 'A'; $ref++; var_dump($ref); // 'B' $ref =3D 'Z'; $ref++; var_dump($ref); // 'AA' $ref++; var_dump($ref); // 'AB' ``` I've seen this used a few times, e.g. starting with a numerical value = (Passport number, NHS number, Social Security Number, Date of Birth = 20230117), and the developer simply appends an incrementing letter on = the end to get a unique reference; e.g. a person having multiple = assessments... especially if it's more than 26 (A-Z), and you need to = move to multiple letters, which `chr(90 + 1)` cannot help you with. That said, I appreciate that incrementing some strings can be a bit = unusual (e.g. "A9" to "B0", vs "A 9" to "A 0"). Craig