Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112966 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 12207 invoked from network); 22 Jan 2021 21:33:04 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Jan 2021 21:33:04 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0E6111804CF for ; Fri, 22 Jan 2021 13:13:35 -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,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 ; Fri, 22 Jan 2021 13:13:34 -0800 (PST) Received: by mail-wm1-f52.google.com with SMTP id e15so5526833wme.0 for ; Fri, 22 Jan 2021 13:13:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilo.me; s=google; h=to:from:subject:cc:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=XumKBdwJZDWfjWCMI+9CdENZFQALlYQiJTombBspk0s=; b=LepdhkkykY7+DlQfQPcCT9yz8iK0fiTFc3MJihf0zFW6Tvxp8E8GgonYt3RxzXcy+f QJjv0N1bV8oU1fG7AK6F8iI7EpEwMbYvhpCB4k4yITPpUG4UCwihGSkj3yY8+Ln6Y557 7DE1AZEnOl371Eqn29AlfI1l88etpSXXlZGQDvkLNhh4w0MbddYt+DSosKriq3xOAeT4 xpUIUsH7G4wVRy8hOFlFYd2iQggRU1YGOkGtxx58F1p+OVs27wECsoy8C3aSxYtUacfH n8qoSmoRNVKxUpaDg+SkTp5gJ+Op1MlDnn5iV8p3WTmUcJMdqURbK3uS7Ah4Fw2v/6Ov H0IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:cc:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=XumKBdwJZDWfjWCMI+9CdENZFQALlYQiJTombBspk0s=; b=ZBh7aYNfxEV5P1jszi3biAmEak9b/fmBvAQSdlXYqcCA+mVMj7ykjnHNhQp7uRRchy eZ+3SQ8ceAaXtqiRDreL6RgFNWOgo02NhmXRzz3OePRLNWSOd712mgqxNo54RSYkR4td xrRbgggt7dfEl6H/fLw+59jvJxg6YzyAkQRxxUUYXflgl2vpVwHynjSJEz1rL8JS+p6Y rVyS6SWM3WiF3hSBN8cvN88jV2NRm056sb9qkPc9S5dpn1cp4MIFkVJ3UuMQTs11+lKT 9695O3bHa4Mkmhecn2UPcfHI9+mkq/oXehTXoNreXPCArj86CL2TWCHglgj9tS7VDdeU 1LZg== X-Gm-Message-State: AOAM531tbCzn+xZxKJOBpQiJ9jItoV1F9eqFqq2iABD/+ZZLsCU3yc9q M0XWzsVKO2QIPGHlCBbnChgq0A== X-Google-Smtp-Source: ABdhPJzu1HHPCNJk8a+cu0Gt0R2Jsvyc1n0NgOOxw01udXLVHPG49+bUCsVf5xiUWehyIh7b9bOO4A== X-Received: by 2002:a05:600c:230e:: with SMTP id 14mr5610793wmo.161.1611350012301; Fri, 22 Jan 2021 13:13:32 -0800 (PST) Received: from [192.168.1.10] ([178.121.94.157]) by smtp.googlemail.com with ESMTPSA id n16sm13171315wrj.26.2021.01.22.13.13.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Jan 2021 13:13:31 -0800 (PST) To: internals@lists.php.net Reply-To: Alexander Kurilo Cc: nikita.ppv@gmail.com Message-ID: Date: Sat, 23 Jan 2021 00:13:30 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US-large Subject: Optional E_DEPRECATED for 8.0 in 7.4 From: internals@lists.php.net ("Alexander Kurilo via internals") Dear Internals, Recently I started investigating how to migrate a fairly big project to PHP 8 and while most of the changes looked safe-ish, there was one that I was particularly worried about: few comparison rules were changed by "Saner String to Number Comparisons."[1]: Comparison| Before| After ------------------------------ 0 == "foo" | true | false 0 == "" | true | false Would you consider adding a switch that, when turned on, issues a `E_DEPRECATED` on comparisons that are changed in 8.0 into 7.4? While it's kind of against semver, PHP doesn't strictly follow it anyways. It could be opt-in and I'm sure it can help migrating big applications with poorly tested logic that might rely on such comparisons. Nikita seems to have worked on this as there was a pull request on GitHub[2] that is now closed. So, is there a chance for a similar patch (with a new ini setting to make it opt-in) to get in? Patching and building PHP manually is always an option but I think that's not only my me who would benefit from it. I assume, an RFC is required; if the feedback is positive, I'd volunteer to work on it; I'd appreciate some C-help later on, though, if it goes forward, because I barely can C myself. What do you think? [1]: https://wiki.php.net/rfc/string_to_number_comparison [2]: https://github.com/php/php-src/pull/3917