Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119348 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 76078 invoked from network); 19 Jan 2023 10:47:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Jan 2023 10:47:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D04381804B0 for ; Thu, 19 Jan 2023 02:47:36 -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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,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: AS8560 212.227.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (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 ; Thu, 19 Jan 2023 02:47:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1674125244; bh=W4XhPfUaxY98K+BoOxOh/r5vAe5eDXwIa+eJR0A1C7s=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=Bj1SRSCzoTs2fi+snNQxWdKBYD/xpf/XsSgjUjmfVfd8WApBIBTE3+TC8yKqPvTCx os9bg0CJZA+gjXFYC+mAxxPnUmTEJvFbPyRhHtdblfdToBzG1hyAaqOmnV4nFd9pc+ eo17Kc/CSHwDNXHBtG6anUVe2otSAQ1X9KWKC7isoOv4O9j8ZaEaBSrwVht0B9KwEs 8U6N50CtQxLF5+TCiUKz8ThLW+SY1jFRVIZN7NxdcAiWbNI52zqcKF+Z6elF2f7KW0 umolLIBPrddQGrAorVizaAlhvtHgQ2wBGd67DGdNq+Z/GEM4daSmBrfKxvAS4C9q8t QY9RseKG2TUXg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.2.130] ([79.220.87.202]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MOiDX-1p4TAK3tq3-00QCwH; Thu, 19 Jan 2023 11:47:24 +0100 Message-ID: Date: Thu, 19 Jan 2023 11:47:23 +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 To: Mark Baker , 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: <768de46c-9ff2-eee2-24ab-e78e27ad167c@demon-angel.eu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:pbUg8IW/Fl12FFzX6yifP4VHV4QuIPYYwyZ49ExV10wR25TT6SZ M0gt6q08JiLoPEEnYbH2AIJ4gvbQBQv873hcdDTQlPTSC3UwGHvMtU3kyVWAkJ4my6dVXnf Hlb0VrLOayUMllk/6+ZyPq7fRlPxt0SL8/CNbYUaZTKLyliIC7DqEqx+nj0h9IM9R3VDARA Ej0GD01SQqZbPELzQJw8A== UI-OutboundReport: notjunk:1;M01:P0:bdZZhQX6I/k=;N3Lt6uW58D+Qn3lHB1Ne9B/M0t+ AzxaGZQMj9maABDsIgDD+pYLmpTiryQcZxpHbM5jWOeJj9l8fwXIcyg+I1+josoAXsHKv1SxH eacpkTHGJxmzOuK+DtCN2a6ZNWVUKv5NXQafJceI+esPSy5u67yIsNqvIogNrexktQeKbV3Tp lw4rzy5c10a98uabOW6QyN8L2KCIkg4LMMtcJsb1623W3xP5PjkWUUTS//rlTLVo0Ms4cDVmz 0MSz0mYA83dBpqW/hu7w9kkh9I9/qDxJX9oEP0XABw0ehbJk1q7b0XyvxxjrEKeanl47F8hML x9G54lvpcshK/K5M0+2hZOg3ZjwjX4X80ZQ8HUyycqF+cq1T3GqYE6cUZDJgfDaDi/nMlmJU2 LlsOCxDrlBnh9Mw5Woo4IQrCw8SOvWTHbgifHDe1dWMUWGV0VusDQlI+jyY+m2UvkcW3m5yFy J4HSjO85JWpjWBKDr1BasT75+Csxcgjd3LGBPPzY/HrUgYddQ74ebeo52oollzV49BWCGgT6q l0P+gf99j4RHNq8qv+PyVQB1HvF7lrRekCtTe5/EIo5RXW7Qs16dgsuN/ka+e5h5GGA9sfOUc g74Fry5QxIJMCFoNQBCKF1IKAt5aPKMU3j9Bh5JxDLmKpFzqpAjUbTLvhJbcO0e1EY7fLmpLk 66D7dGsTQsku5dyL0OgTCy6suiaKyZVMBDYfl8jRlgHkBRnf5a+hgMePUesJP6vFfVafQO5PZ gV6Ym0f64emfRCbsqyrwX9TrSBVGe7CQTzR6KDc6nW38BKnvspN2lLqbA7xZMvPJzmR+pL4vm EcnUqspe1a5nTXdWWe5cLuAfX2DoynD5KrqfE4xZD8tUULrr6al9gMFhGXgLhhNqfb2fC1dSR phMSyJxQ5cBl1MpwUvTTulhMaY/zEBUTOFfxGj+8upxauiF5/Rg0lakuw6P4edZ6iHkoquktV lFTx+97yDNFK3kHI0JzAXasos6g= Subject: Re: [PHP-DEV] [RFC] Path to Saner Increment/Decrement operators From: cmbecker69@gmx.de ("Christoph M. Becker") On 19.01.2023 at 01:23, Mark Baker wrote: > However, the ++ and -- are the "Increment" and "Decrement" operators, > not the Add1 and Subtract1 operators; while they behave in that way when > used with variables containing numeric values, they are special > operators and not simply a syntactic sugar for +=3D1 and -=3D1. As long = as > their behaviour is consistent, and definition of what "Increment" and > "Decrement" mean is clearly defined for different datatypes, then I feel > that the PERL-style alpha string increment has enough valid use cases to > justify itself. I understand your point, but also understand why increment/decrement operations can be seen as adding/subtracting 1 (the current documentation is actually pretty close to that interpretation). I'm not sure which interpretation I'd prefer. > We might also discuss consistency of datatype changes when these > operators are used. > > $a =3D PHP_INT_MAX; > > ++$a; > > or > > $a =3D '10'; > > ++$a; > > both change the datatype of $a; which isn't documented behaviour either. Well, that is the usual type juggling, but is indeed not properly document, from what I can tell (the "type juggling" page doesn't mention increment/decrement, and the "incrementing/decrementing operators" page doesn't mention the type juggling). =2D- Christoph M. Becker