Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127951 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 8841A1A00BC for ; Mon, 7 Jul 2025 19:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1751917652; bh=EPtymYiEfMJuJNNRDw7iQpFNHfHXM3kxpaJM+feeWLU=; h=Date:Subject:To:References:From:In-Reply-To:From; b=CuWrfR+IyOj9c/yZrvgRvOPEu6rrcuCkZJu3VPlLPc3haXrSxnekUiUfZyN5rFjzv 7170R94TyGEni5jGGnU9X02RFrTUJwCqEJ3HUZTsOjl7KzZ3s/uCAhfrgjkEzo5FNg 7IBy3E48wQrEXu5PLllp+4EY3ivs9Wu8iSIoA9HXs1tPucEzbiZEgOHd1+PSjnKuX9 JyQxMz+2XPFLimvz83t+pSB7kyABVl9PZXqKs7xdjKydz+T93co7XhR4OcjKA6YPLR 91eNCxE4eXt+jzbbZVdDoMUBbyjKdNW31qgwPAvP+yv2qeVIefsRtgIJkzpDy+fJjv fbR/u4PL9L/sw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CB83A180550 for ; Mon, 7 Jul 2025 19:47:31 +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.4 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, 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-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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, 7 Jul 2025 19:47:31 +0000 (UTC) Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-453398e90e9so24445695e9.1 for ; Mon, 07 Jul 2025 12:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751917761; x=1752522561; darn=lists.php.net; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=o3CcnjRm7a3BTfsix4Acu3WJeBzvyuPlLaGcHwp0/OQ=; b=c6sbOT+wKsMJEoYPXRgmd1P0iJCmliKk2RVLVgFfQLlp2FfYiqXLVOU3Y2+wwdf0s+ Yb/BD2Zxa7Y4/m2aEB1z4tJ0kgyGzBFa9Q5F+jM5hjOwU9w2SErZyjvVwGAHsPiqkbNY iSSApUR9aO6PtKA8FQlLB5tlOcUWERP/H9gZWy0FYG7T1CeoT5uqtZCGz5RjnP4oDEct nbLPjTV5u7YUA1rxYx4u9echIj7rbXkbobdxuGGwMNkLq8BQVvadmq/PVSH4MyIO71vX It49JkLspa34/afnoTifXc9qMD3qBI3ag6vpLa0/XI8Tc6UHQJm7GsPxEfpyl2Jauvwf QbYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751917761; x=1752522561; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=o3CcnjRm7a3BTfsix4Acu3WJeBzvyuPlLaGcHwp0/OQ=; b=EirPjZyfR5mh3UEcl08o2vOtNy5eLa4Ogx5xvhECF87o9nb62zQleHHk+RCb3G5M2x C9ULPbjZCv385QoZS303DH75zCTTRwEnAChilgzjQkQw4RMHGSyvj/GD7MGGkFdTk6TY 1TK7n+af/XoODdEzaPCwHRCOxBWCeq/reA9v3XPZ0Dfnc92frpBsnOzGMNselOSjZOZI l4CMqFRxRr4Fxc28UZbec4Hf5GfPKgy074G0mtTquX7HsaJmNGCsktOg0TXz5qvVIk72 N8Cv/X6PZFDgrBhpQ9TUzg/2c3wM2NDQ+qijjPck+wMAD3YL1g2IRzo3e/MgOfDdB6XL ingw== X-Gm-Message-State: AOJu0Yz+vyQXu6xTj5VUOOXds/nHIf9ccUcIDfOvrMFlLw0zaM7q0XlO gLFovKoifJlJENeCXwHfS+OqVy3SxXmYCLBEt4MLF8ryNL23/YkJRJi085FI7wWg X-Gm-Gg: ASbGncuOq+NaSWLLiTVz9FB7/3E5vmA4WVWTNvokOlzf4pZ5y8Zr22NkeAwWfRnjle6 sLKQrfqSBGhYikZCn1veAlqj3nSjTcWPn6jRjPBZ7IY93xWN67h/R38liEeKVY3iIZZ+T1+sYsi xvJPp9E/i0rjIS1jg7pnopSwOltZQbXpd7e3yGkOiEfOKm5MozfiF5q9/d1Pu7QlR615jP2SLJ8 93RcSmuJnA17Lhxb+yRfri9jJuMjpDcfAZ6VgY6jOFgxqNRtu73TVIk1vc57VkQ105quZV9Iu28 ULcn1saohDJ/woogFN9eDpKZdwTeO4ec8Qh7wepYd2DGkgbpCBPepQeKJ5FfUDTERuA6IiHNMUu NOgvgS/QGN/wpEQ4UVmEneksXBSiOhks= X-Google-Smtp-Source: AGHT+IEm7Sk4oUce308f7UIJgu4sZETusToQZ2EjvaUy3bUBvNOws0lPdRw+zinxJ4kbo7TSSBYOdA== X-Received: by 2002:a05:6000:40df:b0:3a3:7987:945f with SMTP id ffacd0b85a97d-3b4964ee23emr11799450f8f.57.1751917760927; Mon, 07 Jul 2025 12:49:20 -0700 (PDT) Received: from [192.168.0.241] (178-119-85-231.access.telenet.be. [178.119.85.231]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-454cd49398csm852085e9.22.2025.07.07.12.49.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Jul 2025 12:49:20 -0700 (PDT) Message-ID: <3afd943d-bd61-4abb-a81f-ac99df91f770@gmail.com> Date: Mon, 7 Jul 2025 21:49:19 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] Deprecations for PHP 8.5 To: "internals@lists.php.net" References: <1yx0GE3X9ysln_bTni-MXXWHDPtPXcmPKaO6bySOiGjkjyFCMCB_wKz67XuEt_sifpZC63kkzreaNt4Trlrpir4MKRCgfkBV0X00cvQq1dA=@gpb.moe> <3d3dfc56-3958-4997-9172-118d0e89950a@gmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit From: dossche.niels@gmail.com (Niels Dossche) On 07/07/2025 21:19, Theodore Brown wrote: > On Mon, July 7, 2025 at 11:03 Niels Dossche wrote: >> You're allowed to do $array[null], $array[3.14], etc... and the key will coerce. >> I expect array_key_exists() to behave the same way as keys on array accesses do. > > I'm confused what you mean as well. The deprecation is for both array offsets and when calling array_key_exists(). > So $array[null] should output a deprecation just like the function, and there isn't any inconsistency. Okay now I understand. I misread the description and missed the word "and". However, I still need some clarifications: From the RFC: > Notably an offset of null is type juggled to the empty string "" rather than 0, contrasting with how values of type bool, float, and resources are cast to int. Why is this wrong? Why must it get cast to 0? From the RFC: > Which is even more surprising that the other operators that accept both string and int are bitwise operators and they throw a type error when attempting to use null with a value of type string. I tried understanding this sentence multiple times but I just don't understand what it's saying. Even presuming that the first "that" should maybe be "than", I still don't understand it. Kind regards Niels