Newsgroups: php.internals,php.internals Path: news.php.net Xref: news.php.net php.internals:128126 php.internals:128127 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 lists.php.net (Postfix) with ESMTPS id 1212A1A00BC for ; Fri, 18 Jul 2025 19:39:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1752867445; bh=WCeiNa0EsvEckJKbRtmA1y5NFjOIBUlSJuUdd348Qjk=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=MO/knK9iG92B/BJy0YcPYVz/pfZVVokmcps/3gklxgt5pwA+u7r9x8NSTTNw5dbzP 5jvxa8R3m+jePPguDsObV86zxQ6T/qs/2copAixt0NSnYWxgjrdut2pngg2p8Jor+K 1BjYAteFI1ZTMp4mrFCl/LsaucyfZnDvpbj9ha0rvlEjUVmgtOtO87Fy2S36JzeGw/ qCMrKbJUNts9mZTpq2PRGTiH13zWIArDCjSm9Kbl1e6wbsLryjoS7AjMkfcQZXHqf4 wDugjXF/SJQR+Q9zm2iUCEf8ITXhEK7MVHWFTmcRHq4v+byYvt1XSjT7CFzdMkL8cw QgnB8QYgN9yHw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6937B180003 for ; Fri, 18 Jul 2025 19:37:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 ; Fri, 18 Jul 2025 19:37:24 +0000 (UTC) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4538bc52a8dso19370475e9.2 for ; Fri, 18 Jul 2025 12:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752867549; x=1753472349; darn=lists.php.net; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=ptSkshscAfW3kWdCqGk08QQ97Vp2H6nnKcoCz/dYp5E=; b=SFvQjY4C6FR347L54GUrXeJYYjxdOGR0ngqCwjPKiH49O0a/ftIwXwzlIIO5C6AG7p ReTo+JFrkN4RJU/CSEfn7KdKJFMmkxpdkPiSRlxxI3dMLQEO8g5NYgb7G9sLCS3CjDsu rf7u00K5ylE0FXUsnYQfv6P7xSpT6zg+oqC2Mlb2smo3oY+1vPWqCnRnsr/iNLKtXXuy fAXEeDNeP+eV5ZArfMS8WafLNGRZyhP5Sns44zd1U/3wh6068YGt/k8Z+0ToEM4DeaL0 c7gpScSZqyVMBBSr8zDYVA3Hx3c2yGK3ZtwD+7NKdkfj5OVpjkqFiVrU7IhS9VIkdfcQ pkOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752867549; x=1753472349; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ptSkshscAfW3kWdCqGk08QQ97Vp2H6nnKcoCz/dYp5E=; b=ZRW7Zzrh2lUMp0nTj3ad1BSonkvTcgZJetC7jsuvkMGTER/QUwGPdB2rF3uKBXPxw0 H05ZHEVRd+1CCo/9uhhjOt86DxHW9lfTYe2Qqv2S+1hshoQOTUceRkLpe0yUMxTJM6tQ hMxoQgU3/JnMNL0olxxyZd/WsyZCY9f2b0rLcRYCDfFgRzdD3tGWLLDO3CY8OQ58V0eV ioeiH6zzNt3wlQLWiHbuDBgNiIo/iEpnznddQ6Y7yhURvZuiFoHLh0qx0Q38C/eJqPgj +UoT5u/Vb/1rHIyAH8DYqP1d6ankeNh5L+j2vAXy7P9VsTByi1rEE2IG/b5xCsWBFFUw LSWQ== X-Forwarded-Encrypted: i=1; AJvYcCUKQMjgWgypmRBlrJ11WGo1Q2nYFR7ICwQrVPn12EOOwqpSi9DfRPWrsgz09uQVAMEtDF6WGS9Gtrs=@lists.php.net X-Gm-Message-State: AOJu0YwCCHiCv2nRjxgwrGQceEKbPyWZtpoP8r1EKtEekubxaVIN0hBG RO4+hxVi9z3Xt8X+pRewqxBTrDi7I1nkIHAwoXiCJSChyNFCJtTWnSyrvm329Q== X-Gm-Gg: ASbGncstYWwQME48rqQ6RiEFf3nOAMzevtCyL8wtDmsH/3OdP2Cb/bobpYM7jDMZ4ES bJKTfCu3nZeE7reLO4li5gV5W+gOTLNmjL3qMG8KzxOKXJwTZ4zkzcyJDvfY33nRz64e2v0NrnT p7ofJovBJlL6v4qAE3rd5ruDXNEif9ZEvKqBq+/xSmDcdcynNVocp2CZXNBhneFJbTn2VnwAIjv AgnF3fEXx3PLhdSWUxEMOYPEj8JakFucOKBNa44LXshbc42xcqMyBNWfniMXXl8qJ77NuydHssE bOPlk1X26c1rYOcTwqXmPAhKfEcfSqAq3IqpwN3SJjvyKWVIC1umNebd4Dbq+6fWJcyhzgQXII4 Pfdd/YQPx2X9gLlbj5zgncV0sapeErBaWCialfRwUvelnfA== X-Google-Smtp-Source: AGHT+IG8QLnt38gDuwGjhHNocDzE4gahZW3ZchYeGt01Cr7r1d5r/wwXpVq20L/nLKee1+Eb8E5LzQ== X-Received: by 2002:a05:600c:6298:b0:442:e9eb:1b48 with SMTP id 5b1f17b1804b1-4563b8f6167mr32256975e9.24.1752867549122; Fri, 18 Jul 2025 12:39:09 -0700 (PDT) Received: from smtpclient.apple ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4562e89c739sm85889305e9.32.2025.07.18.12.39.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jul 2025 12:39:08 -0700 (PDT) Message-ID: <4CE76107-60FD-433B-B577-F0C9FF8F3A19@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_315E2683-5FB9-4D09-A494-078A132F5CE3" Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: [PHP-DEV] [RFC] Deprecations for PHP 8.5 Date: Fri, 18 Jul 2025 21:38:57 +0200 In-Reply-To: Cc: Daikaras , PHP internals To: "Gina P. Banyard" References: <43b55cf7-bd7a-40a0-90ee-0b9dd67f54bb@daikaras.lt> <6dxtR-lrZ-CVEhWWJp1IlCYt8_v0u16-lWG69EeyJAvUQdlDeW-2VgKZ7tezX4fG-JhORVaXZa9Kotnm8WlM6Mz7G1_NzzhFSozx3wuEHTU=@gpb.moe> <7808C18B-127F-4C60-914C-CCF14FD74055@gmail.com> X-Mailer: Apple Mail (2.3826.600.51.1.1) From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_315E2683-5FB9-4D09-A494-078A132F5CE3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 10 juil. 2025 =C3=A0 13:18, Gina P. Banyard a = =C3=A9crit : >=20 > On Wednesday, 9 July 2025 at 22:26, Claude Pache = wrote: >> Hi, >>=20 >> A possible reason for wanting to use the non-canonical names in = settype(), is that those names are returned by gettype(). Fictional = example (not intended to be reasonable, only illustrative): >>=20 >> ```php >> function settype_from(&$a, &b) { >> return settype($a, gettype($b)); >> } >> ``` >>=20 >> Personally, I have used "integer", etc. instead of "int", etc., in = settype() in the past, because those were the =E2=80=9Ccanonical=E2=80=9D = (as I perceived) forms returned by gettype(). I have slowly fallen out = of that habit in the years after I began to use scalar type declarations = (introduced in PHP 7). >=20 > We are well aware of this "issue" and get_debug_type() was introduced = in PHP 8 as a replacement for gettype() that returns the canonical = names. > The one difference is that objects return the class name rather than = "object". > I can add a deprecation of gettype() to nudge people to use = get_debug_type() instead, if you think that's reasonable. >=20 > Best regards, >=20 > Gina P. Banyard Hi, Sorry for having forgotten to answer to this point. To be clearer, I = think it is fine for `settype()` to keep support for the legacy names = ("integer", "boolean", etc.) returned by `gettype()`, even if we = deprecate the syntax `(integer) $x`, etc. The syntax `(integer)` is = trivial to correct with a simple search-and-replace; such a correction = is not straightforward for `settype($a, $type)` as $type is not = necessarily a literal string. Moreover, the $type argument in = `settype()` is not confusable with hypothetical user-defined types = named, e.g., `integer`, as user-defined types are forbidden in = `settype()` anyway. =E2=80=94Claude= --Apple-Mail=_315E2683-5FB9-4D09-A494-078A132F5CE3 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

Le 10 juil. 2025 =C3=A0 13:18, Gina P. Banyard = <internals@gpb.moe> a =C3=A9crit :

On = Wednesday, 9 July 2025 at 22:26, Claude Pache = <claude.pache@gmail.com> wrote:
Hi,

A possible reason for = wanting to use the non-canonical names in settype(), is that those names = are returned by gettype(). Fictional example (not intended to be = reasonable, only = illustrative):

```php
function = settype_from(&$a, &b) {
    return = settype($a, = gettype($b));
}
```

Personall= y, I have used "integer", etc. instead  of "int", etc., in = settype() in the past, because those were the =E2=80=9Ccanonical=E2=80=9D = (as I perceived) forms returned by gettype(). I have slowly fallen out = of that habit in the years after I began to use scalar type declarations = (introduced in PHP 7).

We are well = aware of this "issue" and get_debug_type() was = introduced in PHP 8 as a replacement for gettype() that returns the = canonical names.
The one difference is that objects return the = class name rather than "object".
I can add a deprecation of = gettype() to nudge people to use get_debug_type() = instead, if you think that's = reasonable.

Best regards,

Gina P. = Banyard

Hi,

Sorry for having forgotten to = answer to this point. To be clearer, I think it is fine for `settype()` = to keep support for the legacy names ("integer", "boolean", etc.) = returned by `gettype()`, even if we deprecate the syntax `(integer) $x`, = etc. The syntax `(integer)` is trivial to correct with a simple = search-and-replace; such a correction is not straightforward for = `settype($a, $type)` as $type is not necessarily a literal string. = Moreover, the $type argument in `settype()` is not confusable with = hypothetical user-defined types named, e.g., `integer`, as user-defined = types are forbidden in `settype()` = anyway.

=E2=80=94Claude
= --Apple-Mail=_315E2683-5FB9-4D09-A494-078A132F5CE3--