Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114767 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 10756 invoked from network); 7 Jun 2021 11:49:15 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Jun 2021 11:49:15 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 975971804CC for ; Mon, 7 Jun 2021 05:03:42 -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_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 ; Mon, 7 Jun 2021 05:03:39 -0700 (PDT) Received: by mail-ej1-f51.google.com with SMTP id c10so26178527eja.11 for ; Mon, 07 Jun 2021 05:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=4ftzVj5utDOnUKHZrOtIMxOkduAXWiqhButOUsGA+aI=; b=elFmPTZ2V9ULFBaeh4wxbBw9wxdx2MNUTOVPqP9RCfz/ydhSN49n92B140eULbI4Ge Ju33FXsGulXo9m9tfSezSwgPJpPuKX/jj2gDJVl5Ep29cSpDOElZKWMKG9CbNQsKIjmP fE7nuZY8bMoDWFHsUH+uqBAUD404XIX31YkywYQCUYWbthtyvNUux6cD2+RA+24lOZSq 79MJEC4zX2+37TOsUrx3VeviIYxe9sLgEuUpOQ/nmwJ+qA5TJfEs/RIbjKVM5LXEAeWJ Q5DYmVQ2JTrqFIn/ECoA2ZRE/c47UI0iud4jnN0YZf92balvGCMIJvgqObf6bjKwOxkZ yrfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4ftzVj5utDOnUKHZrOtIMxOkduAXWiqhButOUsGA+aI=; b=Bfl0laboXr2OxJsG2L/+85Phu+Ju/8wv4/7q1ptZ6ryH9NpeBUa0LpjDJedej3qv41 4BrYJF8RzO15ZX0g/VKiKmbeKkvm6NmgMYwosNVVzRZ/F+N0ys5F2p5HFlC2uGMnL4Y/ Hdy4t66pBS9f4/p9+NTc+zernzgvQKV+nIgY2A07tQOhrZbC0SKsmTXdS/MbRG9Irsq4 WWKRFx+fNjgUx2S/en09GDR95gBgHNBNaIioLM08jN7CnfwMjoE7XJxTHP3Oani0lm41 S5/SZcricc5BpXJd0SCrb27ZColtA57X73+FQlYCDD5qp7JmUjBkoEhkDVCRrxvEyU1J 9row== X-Gm-Message-State: AOAM530RzBKYFbBZ4NJ1KHeP+Qwh7Ut0ndkl4em0+WWlcAPisLOXelP+ mSymmxOvvO6N4n25G9r3GhUIf88DuTo= X-Google-Smtp-Source: ABdhPJx30HOY9f7rNvFyCh2GbXDGpviIXAnR5ME34Za531Q232Y1HaZIBvb3SADmXiSQU0pSaafZmg== X-Received: by 2002:a17:906:4e06:: with SMTP id z6mr18121494eju.34.1623067414606; Mon, 07 Jun 2021 05:03:34 -0700 (PDT) Received: from ?IPv6:2001:983:6fc5:1:e9a4:8959:49f:f721? ([2001:983:6fc5:1:e9a4:8959:49f:f721]) by smtp.gmail.com with ESMTPSA id u12sm6390656ejz.1.2021.06.07.05.03.33 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Jun 2021 05:03:34 -0700 (PDT) To: internals@lists.php.net References: <6D61A2FD-DC80-43A5-81C2-FB19F9CB5078@dafert.at> Message-ID: Date: Mon, 7 Jun 2021 14:03:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Policy for procedural style in new additions From: dik.takken@gmail.com (Dik Takken) On 07-06-2021 12:40, Nikita Popov wrote: > I think that not adding new procedural mirror APIs is pretty > uncontroversial at this point. I think one open question is regarding API > additions to existing classes with a mirror API -- should we keep adding > procedural functions in that case? I guess maintaining consistency between the mirror APIs makes sense for as long as we still have those mirror APIs. > The more interesting question here is whether we want to deprecate existing > APIs. From a quick look, these are the extensions that provide procedural > mirror APIs: > > date > finfo > intl > mysqli > oci8 (only partially) > xmlwriter > > I don't think I'd want to blanket deprecate all of these. I do see value in > some of the procedural APIs (okay, only date really) or at least historical > importance (mysqli is a migration target for mysql, which was only > procedural). I think if we want to deprecate these, it should be on a > case-by-case basis. For example, I see very little value in the procedural > intl APIs. > > One annoying factor here is that these mirror APIs were often added > thoughtlessly and have design issues as a result. For example, > xmlwriter_open_uri() makes sense, but XMLWriter::openUri() should clearly > have been a static method, not an instance method. Similarly, mysqli_init() > makes some sense, but mysqli::init() is entirely useless. Deprecating the procedural APIs where it makes sense sounds like a great step into the right direction. Historical oddities in the OO APIs could be dealt with later. Regards, Dik Takken