Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120150 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 15129 invoked from network); 28 Apr 2023 08:17:04 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Apr 2023 08:17:04 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 65EF81804D5 for ; Fri, 28 Apr 2023 01:17:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 28 Apr 2023 01:17:00 -0700 (PDT) Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-2fde2879eabso8710106f8f.1 for ; Fri, 28 Apr 2023 01:17:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682669819; x=1685261819; 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=OZ2fsE3uEdWZwkBfylGVcnsCP3rGCoqqfAWCg6K2Eys=; b=c6OeFKQpdY5HAj2C3klBEz2OeSqMAkzkZECjoKRDB6Rk7tZ8NQQfbjHRG+UktMrBIS i8kFjxuXZHsUdSgTwzGgo0+N7ZG36e4p3Gl2fPqG1gr/vBKCqBhDsJXbVDGqYQkcQeoR rThjaui52usvh7wvD5vpbwFKliwk5WeY86kvSI7/eMTBzyE0uAFIEvFXPKIKiQN3rerI +KmCpw8n0Y8kBoUxz0dyID4kXbPpmLEcDu2VeG/tluTghP4QNMg8+mzvf5xVNgfS7gjI Dl3JUyI18IlUcGuMAk7TJJghg3PHJOAkUGlFe6b69zbhx05QQ/dAiYpaZa9eCbbT697E Ed/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682669819; x=1685261819; 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=OZ2fsE3uEdWZwkBfylGVcnsCP3rGCoqqfAWCg6K2Eys=; b=HQnpKScNbA+x1QQ2DJgOz56arix4WGvHWtrGe5GIeo3OTVtcmTQMYofY3db8MuJ61N JU9WwGB+54P8tcb9eSqy51pUqEZv0hSwEVH6gx751C8hpaoTN8dvEzxMfj/Depbw5MN9 P9xi7LG9m/ntxLfcCHmJX79ElAeBV8iTTn2K1QfwGykxtx3SYORxcQghuwJITNM7tk70 NAYEQzilDhc1vH0cFQG2zJBKeo3PTgqHwfqnBciIb+yBlkN3ZXsQOmDhwcn1bnZL1LoN grV0Rq7uNoIXSHg+i3iI+evueAC6JdgEpiDANTuI4h2881Xdm8tu3hTsBxnRkUP2yDgJ MhXw== X-Gm-Message-State: AC+VfDw01uD7kfybSHjZxFQe2neTrdlOBOIHCnDqHTV+yEKStBiajtma 02O86np6cMw2RUDYSP+hjRrJdgCY3Zo= X-Google-Smtp-Source: ACHHUZ58NF6ErHJDalNHph3Z+OvWhAWgbwKs++GzlAMt3RkwcCvX5NasZyncFDDvjYZDuAPtoSqdDQ== X-Received: by 2002:adf:f4cd:0:b0:2f5:b1aa:679c with SMTP id h13-20020adff4cd000000b002f5b1aa679cmr3151433wrp.39.1682669819370; Fri, 28 Apr 2023 01:16:59 -0700 (PDT) Received: from [192.168.0.22] (cpc83311-brig21-2-0-cust191.3-3.cable.virginm.net. [86.20.40.192]) by smtp.googlemail.com with ESMTPSA id z3-20020adff1c3000000b002fb9e73d5e5sm20451044wro.60.2023.04.28.01.16.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Apr 2023 01:16:58 -0700 (PDT) Message-ID: Date: Fri, 28 Apr 2023 09:16:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 To: internals@lists.php.net References: Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] [Discussion] Deprecate functions with overloaded signatures From: rowan.collins@gmail.com (Rowan Tommins) On 27/04/2023 22:28, Máté Kocsis wrote: > As you have possibly already experienced, overloaded signatures cause > various smaller and bigger issues, while the concept is not natively > supported by PHP. That's why I drafted an RFC which intends to phase out > the majority of overloaded function/method signatures and also forbid > the introduction of such functions in the future: > https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures Hi Máté, While I broadly agree with the sentiment behind this, I think the upgrade path needs to be examined a bit more closely. As Kamil says, a potential 1-year deprecation is probably not enough, and we need to keep in mind that many libraries and applications need to support multiple versions of PHP at once. If they are to become errors in 9.0, there should be some way to write code that will run on both 8.0 and 9.0. The only ones in this list I can see that being easy for are assert_options (you can write a polyfill for the new assert_set_option, and switch all code to use that), and get_class() / get_parent_class() (you can start passing $this right away). A lot of the others introduce new methods, which can't easily polyfilled, or directly change the signature. For all of those, users would have to write an additional wrapper, with explicit detection of the PHP version to make the call in one form or the other. I have particular concerns about session_set_save_handler. The impact is hard to estimate, because it will be used directly in applications more often than in libraries. The multiple parameter signature is much older, dating back to PHP 4, with the object form added only in PHP 5.4. That may seem a long time ago, but there is currently no incentive to change existing code between the styles, and doing so requires a reasonable amount of work. On a different point, I think "assert_options" is a peculiar name for either setting or getting a single option, and would suggest it be replaced with two new functions, assert_get_option and assert_set_option. Replacing both variants also makes it easier for users to find everywhere they've used it, and polyfill both variants, rather than having to examine each. Regards, -- Rowan Tommins [IMSoP]