Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129487 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 637791A00C8 for ; Mon, 1 Dec 2025 20:52:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1764622343; bh=CCMtJEN8CNYQd3+LRhP/TDMJE+ZJQE1NrYmGpT7BEyI=; h=Date:From:To:In-Reply-To:References:Subject:From; b=Nr7U2961w9NQQk6qRAWTxzy94GkpoKMteyW/NOtGtmfTjRs7tNIQLDI6SaQ/kH/E3 7cc1oVYwI5zsEuHQY9HtuPCEBWIJdCCPdc7R18dMWR38dBm+d9Qw0xTbaHDRkuT2EH bS1z3U7y1jcsnpTTteZshUbc9T7B1Ovk/Z3JNlbRpJ1tuyLo7/IoQOXi30CL3yO9b9 9p9LSCuUJlHDW6byhII8BCqDfkCFnm1dBhWZCnhuBKWEWmL+HIg+nYPCh0rwBT5IQh ub5FhxeZx01VJm6DGdgWtrl3n6DLwAu8tcA0jYaONOq35f3kcyghOkqdRljlrozB9b n887yzNgXljRw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0A7871801E2 for ; Mon, 1 Dec 2025 20:52:21 +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=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 1 Dec 2025 20:52:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thomasbley.de; s=s1-ionos; t=1764622332; x=1765227132; i=mails@thomasbley.de; bh=CCMtJEN8CNYQd3+LRhP/TDMJE+ZJQE1NrYmGpT7BEyI=; h=X-UI-Sender-Class:Date:From:To:Message-ID:In-Reply-To:References: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=YBsULdmis++1I96xR6znw/PyP18+Gryj6w2RVIp6n5EcLNdVEZv4ilbKpC9Gbaam rTmL4Kv3EFSbkd7WOVzFQcpT0OiznRkwsbDecB698N0nApQ0fo1BFMAeVx040csWg cn1I5fgu9lVt13bwcHJsgUYHrb0pThJsn6LpZU7zwZ/95WPAqsEi1NN2feypFdj69 BSelFZMy2I5LEXZhQC4wmmZ1FMD9LE46YDHXdqNuP8/gMlIDg1wSML0JIhduDX3gv Zscyf3QkQCOjMPLOMDMPTZZBgd8JWNuEx75aJOg6Ms414lVLQUiTp9AtPsfqkjQjn VwKHWFzkAOcTf6DS4g== X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from open-xchange-core-mw-default-17.open-xchange-core-mw-hazelcast-headless.open-xchange.svc.cluster.local ([10.73.157.205]) by mrelayeu.kundenserver.de (mreue009 [172.19.35.3]) with ESMTPSA (Nemesis) id 1MXp1Q-1vZwLn3tVs-00KzNa; Mon, 01 Dec 2025 21:52:11 +0100 Date: Mon, 1 Dec 2025 21:52:11 +0100 (CET) To: BohwaZ , PHP internals Message-ID: <1493950126.431906.1764622331766@email.ionos.de> In-Reply-To: <20251201211236.566237a1@platypus> References: <20251201211236.566237a1@platypus> Subject: Re: [PHP-DEV] Change output of gettype? Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v8.38.93 X-Originating-Client: open-xchange-appsuite X-Provags-ID: V03:K1:f2K5sjzXH9vX7hSsZE22TaDPiiRBryg/ykihypUFOLxsss93fUg tSBRIS48rDAFtjZx8opPJ6unlpu5E39eYtW4x2wntkxpdS5/UL6uV/CWA+KiKiVxTh4a5x1 P+ONLI+FEqdq4ZfLSdWi2kHRalF42ssT1V0i/EGdBq7wo/rvF+HqH+Q8TsO113hRLHCBXzg /zpyVZ0nApTlSPT54MXFA== UI-OutboundReport: notjunk:1;M01:P0:9bhpR2jtxsE=;wlK2vkX4QL0VS+Z2gsh9iqfCku5 wluWWqk1YFKZJZmRrQ5op14rs+ewHUVQ+QEG85vDXp2fqQRVJLIfhse4ZFz6fC+/ufbkzaj69 SIPHWpDApmCRlaEH/x49co06vi5lmuUi48uGukl03LS6cCAunD/tW9ZQxly6Hhzgd5UciBHi9 /1K6RkKbiIJW1KF1ifID0AhTPVpc/2yRTDn/Ysy3Nve8t1bXxplPRGk8qTn7Hgu5XNQsCfahF PNfuYfsboeHq1Ggu1SWy53EWZPPASAG9fO7nCnT76Rq5s6vO3vZuGQ/anj+dvtSzp5M12jBfL iNb8gauIDzozyFyw7X0wCPYPHP8WsH+v2Sh914+ZbudiPpQL44MNoRnR8+Ii5ZQLs6uaZIfRZ H0ElI9dHKH3C6+l2k8tBOd2d59/uxZ+wnQO8QEKsFvy3J8XPFEY4MznVMsT/LLVk9q/4ewrR1 NwyXKyp2wshbJTi7Q/fmBq/u9oNozCO4MZp7Nnbd1VCg03FuoOwbmIO4Sc+fhK2DcVNY+Cjbs LgX42cqSzgq2eSJZnxVXtCi0Kzr6JoCMxrjdKFl7XH1Kb2z+9u4Dma5Y1x+OSBp5p/nxhvuUw QJKwyOZ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9gNM/couvTyu8/Vu1 x7qumAFs+YJZ7L6xKR7ORXzDXpTbCiTw6ydsePXvXkwxl63x8pReSs84P5v9Gu4T+39v2wAeX l9J8s5v8cUoDvWkjcekWERPu/eWKXaAyDuw== From: mails@thomasbley.de (Thomas Bley) > BohwaZ hat am 01.12.2025 21:12 CET geschrieben: >=20 > =20 > Hi all, >=20 > PHP 8.5 has deprecated the following type names: > - integer > - double > - boolean > - binary >=20 > But the gettype() function still returns integer, double and boolean > instead of int, float and bool. >=20 > This inconsistency is quite confusing for new developers (and even older > ones). >=20 > I understand that changing the return of gettype might break a lot of > existing code, so maybe it's not a good idea (yet). >=20 > But maybe we could add a parameter to gettype, for example: >=20 > gettype(mixed $value, bool $strict =3D false): string >=20 > If true, then it would return the "new" canonical names. And then in > the next version emit a depreciation notice if $strict is not supplied. >=20 > And then in PHP 9 maybe change the default return of gettype, but still > allow to pass $strict =3D false, so that upgrading the existing code bas= e > would just be a matter of doing a regexp replace of gettype(...) to > gettype(..., false). >=20 > Adding a depreciation notice if $strict is not supplied would make > things just painful for everyone I think though. >=20 > It's a small thing but it seems like having the same canonical names > everywhere would make things more consistent. >=20 > Or the cheap solution would be to just add the $strict parameter > and update the gettype documentation to say that the types returned > by default are not the "new" scalar and passing $strict is needed in > order to match what "new" PHP is using. >=20 > Cheers everyone. Hello, thank you! To me it makes sense and improves consistency. Instead of returning a String it would be also possible to return an Enum = but that would more likely be a new function. There were previous rfcs for new functions: https://wiki.php.net/rfc/var_type https://wiki.php.net/rfc/var_info Best Regards Thomas