Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129903 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 E0B041ADA8A for ; Fri, 23 Jan 2026 17:05:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1769187932; bh=/DGuKqbSTCd+UvrJYpuSk6IeGPybtwV6Y8SVYoKWNvU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=dkOY9g6V8/C75FrFnPMIf1Esl5p4jCXMcjSm+P3qt6h13BtHmfptD/SV6RmXaYy/U Ik9S0zLy/JgMKKCM//1K4g3asTH/carXGy0wmQn5oIunqT301pGwVswX5P43K1fAs6 PICMgj8IhRRfXcw+0HVS3Kc4/Ty6+J1GFPROwoKTRi194/auwK+kaeswqit9CKJ8GK xNzmHYNptmiaYBWfOhmdHniIqtWsfpyqH9cyrWocB5Ieny+qIZIukLK/ndLnT2TTGK vp51xTaqp6/sSJ26NTM2ytW5+cKy6ByOBrvFUR1x5boErdVBGkSftt/Ie5zBOGaDyf dsof3HTOKnYYw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 847DE180797 for ; Fri, 23 Jan 2026 17:05:29 +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=ARC_SIGNED,ARC_VALID,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: No X-Envelope-From: Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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, 23 Jan 2026 17:05:27 +0000 (UTC) Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-658072a4e56so4924355a12.0 for ; Fri, 23 Jan 2026 09:05:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769187921; cv=none; d=google.com; s=arc-20240605; b=UVrRBMKkeBteP/pJ8F9eknWVP/sHgM+YCxTck6FHgKLIuAcwTlEvvO8AEkjDKg5yRN jGBug2GIo6IR/u2Zg7qoE+ywc17+pUJIYgHz9LidX7RwGdVj8cfJACAV0HXSIH6RRFMw SF7sTyo9Dbd8OFsmLX6OvGFVYkcgdOq2yN8CaYMrrCVXHHDIQN4wj3QVXUeHO9D1KqP+ ckN7yDy9Ox8HEy9pbIpFG2S39rLkVArd6beuuulHh/io6Lf4J5lVE1hOFLsXqh0hocYK jXpsDQ2OT0BfYoFiDB7nOVYgvO/w7N9kDX2VxMUeYfKVUQLcFga1unVbM9um0sMkeZS+ dy5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=/DGuKqbSTCd+UvrJYpuSk6IeGPybtwV6Y8SVYoKWNvU=; fh=SpNbuKluJHLW6DkTmUcPMTEbUU8OqJH/3FGR1ACCxPk=; b=iSdmUNuSBN9s686S3d7w+qAi9tYmYzoKbb74lRbW2h7jg9a9wveJkreF5erIOLKisw tdViEVMfAJQttANoPkNKHm9vxTni9eR9gzh8R9dbNq6vF41fDBJviGipfJ4qehS1Iw2d R93A1tjOTGXPK1ACjH400ckIeeZzRL47eI+vPukK3kAve8AHaTpzPCwO+nezUtusFh5Q ZyDUOwVzyx0orTOo6to6Qb4ZtvnUoYXHh+SjmIHjUtB55GhM8aFw9h5ThtD24ePpx4Bs Qseko0mdCCF+4PVO7eAKaiWHgE6YlSCdsqm92CMPkMfouIBP1pk0/pf/uXxBTyWdTjNl GS1Q==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769187921; x=1769792721; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/DGuKqbSTCd+UvrJYpuSk6IeGPybtwV6Y8SVYoKWNvU=; b=eRd0KUpGLkoQmjEB0NgNLNh3gddTI7l3pR77ENimVyio+2IaEcyg1ADHpKz6pnQBHL 9FkKJ0hZW00A83kHxc6dT05RSx8HUEV5+NuIQdGtDVOy3c8LwwpMAZLcIfikBFRqkgFf BanQQPZ6WPsSgIGyyxxKq7R9eED0QYwRyIZGGd76MhBpk5nIH08l8y7riDWNMlpNKnwj fcdTj33m6AB9SzcUkflJSVN2jqHIWGU1PwrkuSJNPErtghgqRodJIfcmr++3+Ccjn99K SdKfPYdlMfVdpbnXHeGYOJUP0pZbQrd1uF+XwWN4nBYPSagPLR1R79yhhQe7X0J6ga+t RbQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769187921; x=1769792721; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/DGuKqbSTCd+UvrJYpuSk6IeGPybtwV6Y8SVYoKWNvU=; b=nboflNND6CfK+xhv0RikRHVKRw5Eie1LdfzKYuyazBM9zYUmckAeqoOmMB83ABl1dh X7hPFQZALuOKMOSsPo1jGxkBSlR5GUWAke+0N6S6KTokSNOfgSlL4aQU632OLt8x6YVQ /2ERvx8fp7MfYvErA6qAmRx4HiEXa8/2cthXWPdxa8RtyZl2yxbOQ3fOrs+mkROpqeXw oHVo27AYLIiix2tS0/4c+3zZnipc0KZZ9b9DyHY4tXo/C/Sq1amW9qRYgnvUU+lnT+uc 6GsS64uFiN5egAZoTm99LUO4plENke774aAlJngD+NZyUvde5KGKpwuz1ulNrZJYfubM UXdw== X-Gm-Message-State: AOJu0Yx1s5t77O8Utww0xLNpdSoxqWzz9ZioLwUFSEXNM/poyV8I5J7Y oakXPY8LV/qfmUP6zkReSC4LFwG94PXsDONPPoU6WlEsbcmWFKzf8qR/W2z04YNA7M344R3c3LX wMU2Ic9c2wphWQBE1Aaxg6Jonm3AjA7NwUA5h X-Gm-Gg: AZuq6aJGEDU1eJLiH/+HXWCbDSD4RyHiu1+fsf5er3p34R7z2fdihrAat2M12XD+Feu B1AtKFF9DgUYrLOdJj6eD59mN+cf92jBk+5Xouz+/zB/6Ra2dwmS5X29Zb7iQj0cGk4V9c3zuB/ sN0E5dvC5QQHGMSTYoCShKwiXfN0iWAa8ljIcS9C+8nwcJm4rh3WMRFn7dVH0RSHDrBmdfdXfWL 8agG3f2YKYCweKfb+S62QXA4KfP9d8/902gDJ2Rqb8N/O6Nu0IC6fUksq1pNjNse7PllShwmx9V b1q8aKICV3tZWg== X-Received: by 2002:a05:6402:2110:b0:647:9380:103c with SMTP id 4fb4d7f45d1cf-65848763bcdmr2465519a12.13.1769187921299; Fri, 23 Jan 2026 09:05:21 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <31563ed1-ac44-47ef-9fca-3ebbfc567ba5@sandfox.me> In-Reply-To: <31563ed1-ac44-47ef-9fca-3ebbfc567ba5@sandfox.me> Date: Fri, 23 Jan 2026 18:05:09 +0100 X-Gm-Features: AZwV_QgnNTaf-vQEWOGLyEQOCKebGN3WLS4mQjUvpPNJtAg5C2tPbpNkGlvJW7o Message-ID: Subject: Re: [PHP-DEV] [RFC] Deprecate Fuzzy Type Casts and Allow Stringable in Strict Mode To: Anton Smirnov Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: alex.daubois+php@gmail.com (Alexandre Daubois) Hi Anton, Le ven. 23 janv. 2026 =C3=A0 15:59, Anton Smirnov a = =C3=A9crit : > While I agree that this code likely indicates some form of broken logic, > this code still needs a clear migration path, so introducing something > like fuzzy_int() function with the old behavior I'd say is expected. I have concerns about introducing fuzzy_int() as a migration path: 1. It would essentially codify the current problematic behavior into a new API, making it "official" rather than fixing the underlying issue 2. It adds yet another conversion mechanism to an already complex landscape (casts, type coercion, filter_var, etc.) 3. Developers who truly need to extract integers from strings like "123abc" can use explicit parsing. This makes the intent explicit: "I'm extracting a number from potentially dirty input", rather than relying on cast semantics that differ from type validation. > Second, there should be a time frame where an old and a new way can > coexist so deprecating it in 8.x feels a bit rushed. To me a perfect > migration would be something like I understand the desire for a longer migration period. However, I'd argue t= hat: 1. The current timeline (8.6 deprecation then 9.0 TypeError) provides 2-4 years depending on update cycles, which aligns with how we've handled other significant deprecations 2. Deprecation warnings in 8.6 give clear signals about what needs fixing 3. Static analysis tools (PHPStan, Psalm or any other tool) can detect these patterns immediately, even before upgrading to 8.6 =E2=80=94 Alexandre Daubois