Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120578 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 69538 invoked from network); 14 Jun 2023 21:51:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Jun 2023 21:51:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D558C180209 for ; Wed, 14 Jun 2023 14:51:25 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,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-oo1-f47.google.com (mail-oo1-f47.google.com [209.85.161.47]) (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 ; Wed, 14 Jun 2023 14:51:25 -0700 (PDT) Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-55a35e2a430so973011eaf.0 for ; Wed, 14 Jun 2023 14:51:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686779484; x=1689371484; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/yo2GgU5xU7fXeBiaGCDxaOfaampTXh0iKc+P9xQqFY=; b=jfdLhVcKnpDpsIXEtU5CEJshtiB+yXyx2Nxg84cdZXJDnERbSinr1CP/wMe+ytfkop OJQoVnknbwGq3OI1biKkiD1lOach3SJY0U0IBsBs/QWh94yHp0aZylGvdOvMnU3GXw13 UbmHBobTT6mvP3twNnDF/imaJfTjtP9eQdVhGNNEjFwDy2ejx233TJBazByb2x1kT4WJ 2BTluuyb+LUu+LmKIZqwdU1EkXtNYZJWPXCvJK5LhjwO8IrcHk7zjQewW0WBoBxeX50i 7LIHp9bZaVeBWOzJxPj4U5hUczH57oKKueiSBNiZf19SP144Z53HxpcNRl/o0z7d+Wsj dhAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686779484; x=1689371484; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/yo2GgU5xU7fXeBiaGCDxaOfaampTXh0iKc+P9xQqFY=; b=EO1Hp7lY17gLLULVVmQSkRrYvMT0a6ce1wDVm/tXjIXrq33oCm2ZV1ZL3UmYqw8z4p cpTiVbyNZ8W5BiJsNm/zND9gVR6e3QNADwB2fHwbvzLsR61HnLMXgATXV0F9usZTTHoO B86Sy4REQUGmdEqDnFM4r+NgLinfxMwERNVNnkTrvcPJFiTSKJgLXeWeiJlhB80xPU9w fZru8/Lw8uvnPVoLClalkUHcQw2iLwKkRA83OGWp1uvgb/6GaDaj6QL1nJytWkqiLBOo Xx9QLZ7ua0UVgDJkAy5IhV5DGUvEJxhs90Ntzal0T6QRHjrvEIq3SgPrvdFxkDtOpoUt SiRw== X-Gm-Message-State: AC+VfDwP6KW0jK+YSw8APx2VFyuwkkBTBP/LuXzrit1SYDWMC2IhMeAj P/p0lT1LlKVt1OypVaHdMBdKGmt+9jxF3vxZ73M= X-Google-Smtp-Source: ACHHUZ61WELG5xSQJeTeD9biC32TUl+oUCs5IEd075P/A2gSPQX3gsF0ihmBimk641mHOYTwFQYHVlBgR3L1j5aqigQ= X-Received: by 2002:a4a:e2c8:0:b0:55d:bbc2:b12b with SMTP id l8-20020a4ae2c8000000b0055dbbc2b12bmr4241886oot.5.1686779484441; Wed, 14 Jun 2023 14:51:24 -0700 (PDT) MIME-Version: 1.0 References: <108411AD-DBC4-4436-8190-7569B7A0805F@gmail.com> In-Reply-To: Date: Wed, 14 Jun 2023 23:51:12 +0200 Message-ID: To: Rowan Tommins Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000fc10f705fe1df395" Subject: Re: Fwd: [PHP-DEV] [RFC] [Discussion] Deprecate functions with overloaded signatures From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --000000000000fc10f705fe1df395 Content-Type: text/plain; charset="UTF-8" > > Given that you've agreed that neither signature is "primary" or "better", > doesn't that argument apply equally to both signatures? If it's OK to force > anyone using individual callbacks to change their code, why is it not > equally OK to force anyone using an object to change their code? > As far as I remember, my reasoning was two-fold: - naming: passing *multiple* callbacks to a function name in singular (session_set_save_handler()) is definitely not ideal - a decision had to be made and I thought that keeping the OO approach in place had less BC impact, especially because previously I got feedback from Nicolas that they used this version. > I do wonder if this change is too disruptive relative to the benefit it > brings, but in that case, we should just leave the whole function as it is. > In my opinion, phasing out session_set_save_handler() completely would be worth the effort if this was the only option to fix the overridden signature. However, it's not the case, since strictly speaking, only one of the two signatures has to be removed in order to achieve the desired goal of the RFC. The whole discussion about also deprecating the other one started only because of improving naming: it is also a nice thing to pursue but fails the cost-benefit analysis. All in all, I think neither not doing anything, nor deprecating the whole function is a good choice. But at least I definitely want the question to be settled with putting this to vote. I don't think "handler" particularly implies "object". The "handler" passed > to set_error_handler is a function, and your original suggestion for a new > function was "session_set_save_handlers", where "handler" would also mean > "function". > Without any suffix at all, it seems like "set a session handler the normal > way" vs "set a session a special different way"; like how > "array_merge_recursive" is a special version of "array_merge". > I think my reasoning is easier to understand if we go back to my original suggestion: session_set_save_handler() and session_set_save_handlers(), which would be session_set_handler() and session_set_handlers() now. That was the starting point, but you didn't like that they only differ by an "s". That's why I swapped the "s" with "callbacks". According to your deduction, session_set_handler() is not the most correct name indeed, but I don't think that we always have to choose the most correct and the entirely descriptive one. After all, neither the parameters of session_set_handler() are called "$open_callback", "$close_callback" etc., they are just "$open", "$close" etc. and I guess they are still clear enough, given that their type is declared which completes the missing context. Similarly, we all would know that the session_set_handler() function expects an object of SessionHandlerInterface type, while its sibling, session_set_handler_callbacks() expects some callbacks. Yes, having the _object suffix is the most pedantic name, but personally, I don't really like it because I find it ugly (and I was pretty much content with session_set_handlers()). I'm curious about the point of view of other people though, because if it turns out that people generally also favor some other name then I'm ok with a compromise. --000000000000fc10f705fe1df395--