Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129488 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 D73071A00C0 for ; Mon, 1 Dec 2025 20:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1764622543; bh=rAY9r762/hDcEeMRU9P6RDCuQ/7ZNQyyXAAamOPN09w=; h=Date:Subject:To:References:From:In-Reply-To:From; b=k3vY6wsIMrzhlkKeaPRMXv5S7jtDhJgmIz6XO0VxpBSLnzS7mKEvNx2Jo7HosP/W8 +I/ALeCSb6YZDiCiKpJN1vh84X316reMeIb1iSYsQl5p4dkVmUtHq5fcKJHrBLyTnV fL61De45OT86nGLrF7PpNYYwV0RgclBuwrP4xFTHQDp5WaluI8gOrWOwB0R15apaTJ LjH9Owjq8bKtmyAUJl+1QCPfkHKer5TKLOkMm5gFxAFsBGVggwNuDsSuxGHBP8MGQ5 Mx4oxs6VpfWsie71M4WSsXEaCRGaQORfJaLb9frJyrbzRzTTp024Y7gSrfNlKmALk1 1ppxCe2jAl+Sw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D6A5F18038A for ; Mon, 1 Dec 2025 20:55:40 +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.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from smtp-8fad.mail.infomaniak.ch (smtp-8fad.mail.infomaniak.ch [83.166.143.173]) (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 ; Mon, 1 Dec 2025 20:55:39 +0000 (UTC) Received: from smtp-4-0000.mail.infomaniak.ch (smtp-4-0000.mail.infomaniak.ch [10.7.10.107]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4dKx4h4R5bzDLy for ; Mon, 1 Dec 2025 21:55:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=processus.org; s=20231208; t=1764622532; bh=F1vTpGLK4iI6PvYVvaS9qodbZ7UZ83E2+he/Cf5TjuI=; h=Date:Subject:To:References:From:In-Reply-To:From; b=UlFN4IisOzqJ4Sxc4rKQNY0Cw7ju0HBOO4S1ODQIlDGaXyp7uDr1QYPSRHWofTWN7 xuiBC4eCJHpS0lBbVNBBo0/trIHlQsH5NU7xBKnpCRH4XbS3e17A+SQOUR2iq8Ko0C aAaKCHP08ZTmTNQFLeMdKyfQXwkkBzU4ivrpuiiIwWLce2h4MKPKhEzFjUhcXn6Aog qYzIQPTqQHbfzMWrTYKtmdYJ1vr0Gfu8ILuIHcWx59xTXSAuPb81SlKwk8N48SM+aY Vcalyvt7ZfQZ+aaUObNB5/LHNUUGyNgmk1ZtpDp3PPjY6eUSR5TOGfm9sV3gldMt9o KjmPvIUj/zeUQ== Received: from unknown by smtp-4-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4dKx4h1bmyzBpF for ; Mon, 1 Dec 2025 21:55:32 +0100 (CET) Message-ID: Date: Mon, 1 Dec 2025 21:55:31 +0100 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] Change output of gettype? To: internals@lists.php.net References: <20251201211236.566237a1@platypus> Content-Language: fr-FR, en-US In-Reply-To: <20251201211236.566237a1@platypus> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Infomaniak-Routing: alpha From: pierre-php@processus.org (Pierre) Le 01/12/2025 à 21:12, BohwaZ a écrit : > Hi all, > > PHP 8.5 has deprecated the following type names: > - integer > - double > - boolean > - binary > > But the gettype() function still returns integer, double and boolean > instead of int, float and bool. > > This inconsistency is quite confusing for new developers (and even older > ones). > > I understand that changing the return of gettype might break a lot of > existing code, so maybe it's not a good idea (yet). And if I remember correctly, that's exactly why get_debug_type() was introduced: no BC break, and it does the job. You should simply use get_debug_type() everywhere and never use gettype() ever again. This is the most sensible move you can make, it really is the function you should use in most case. -- Pierre