Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116745 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 19528 invoked from network); 30 Dec 2021 16:28:46 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Dec 2021 16:28:46 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B563E1804C9 for ; Thu, 30 Dec 2021 09:34:46 -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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 30 Dec 2021 09:34:46 -0800 (PST) Received: by mail-io1-f42.google.com with SMTP id i14so29511219ioj.12 for ; Thu, 30 Dec 2021 09:34:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dwqlNbIRl3UMvKRNsiC6HtMZs3F1NUlyrqFFXkEySh4=; b=ZserSkm24lpJHBBru3DxjFlsx3QZnk6+mSETg1CDJ+anobvH/AtGTtRX8TFc76iyY3 uSD3u8rCjxR6xfMQKL8l486LIGwifNps5m/y45NpQHoWc9X7+NVETz3lSNnuHFQ9WDQ7 Rb4HJ6b4CZ0ZxwQZ2q+yVIuBHkEUpMAXM4vuJUCGe6UIafUj5V4de6BxjDX0q2ciwLsq lZ23qGSpFI4s0Uk7Mse2vVmGjpZUxRI3qSlEZRRRYJkmDNjoM2IzVgu8qGgKXUQqFDHg pALiViNTPn5EB0Af0BirBvcwUmb57hh4RXm7HBwVL2dntiGYuWwURSxlVRNtYJ2mGzux EaSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dwqlNbIRl3UMvKRNsiC6HtMZs3F1NUlyrqFFXkEySh4=; b=y1U+NvcYvE7z1DegRWPmLfAkca5eRoFg7C38rT/Ofdzfz0JtMvGUpZKe3qhSh6gxrF PDVUdtk96AsTF5iwx4TSlxlpv1E3IJ8BIo55doidhVYeNApam6PAFQffxEQmJIa6i61M dLpR79IBo0n7IYI1wyEXW2p5YCYtzNEVd9AtI8iqTxecvSIAF8ymvzg+ENuSlLI6XmVX twji5FUZnlKFppbWPygLFssakMVkjxPtPv722h6bzCgid4Cd1gTTyFzawsH5H2PiYnln cTm4pGBk+3cmNwyJbNKIwQuNdebyXooB6sslr6rDeQfDkLQlJpOms8pvip/JuFNNq8Kd 4iwQ== X-Gm-Message-State: AOAM532QUkAmMqOoRu/fvG32NiQjoRe3L57bHvWtLb6fKKxE6WpnzXY8 ft6sMbatkB0E1BKseu/RTbNemNkPyqijW/bvvOQ= X-Google-Smtp-Source: ABdhPJz00nWd1/l86fqs7woNBAQHpj0UR8tpOe+yIWALwP+SLHXqJohOGnI+oIoYia2Kh1utXYANVuJLt9k9FsnCg8Y= X-Received: by 2002:a6b:fd19:: with SMTP id c25mr12253865ioi.49.1640885685378; Thu, 30 Dec 2021 09:34:45 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 30 Dec 2021 18:34:18 +0100 Message-ID: To: Vincent Langlet Cc: Stanislav Malyshev , PHP internals Content-Type: multipart/alternative; boundary="00000000000064e3eb05d4607880" Subject: Re: [PHP-DEV] RFC: Stop to automatically cast numeric-string to int when using them as array-key From: kjarli@gmail.com (Lynn) --00000000000064e3eb05d4607880 Content-Type: text/plain; charset="UTF-8" On Thu, Dec 30, 2021 at 5:54 PM Vincent Langlet < mr.vincent.langlet@gmail.com> wrote: > Would you still consider this as a massive BC break if > - The type of the key don't change anymore i.e. array_search(0, ['10' => > 0]) will be '10' and not 10. > - $array[10] still return $array[10] ?? $array['10'] > - $array['10'] still return $array['10'] ?? $array[10] > > so it still cast the value when accessing to an array key, but when using > array_keys/array_search/array_flip/... it won't be cast anymore. > "Would you still consider this as a massive BC break" Yes, because `'10'` from an array flip is not `10` anymore, which means that using any strict comparisons on those values afterwards will fail if they assumed it was an int. --00000000000064e3eb05d4607880--