Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112037 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 24002 invoked from network); 12 Oct 2020 14:46:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Oct 2020 14:46:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BE5D41804CC for ; Mon, 12 Oct 2020 07:01:34 -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,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from 2-smtp.kingsquare.nl (2-smtp.kingsquare.nl [77.72.144.59]) (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, 12 Oct 2020 07:01:33 -0700 (PDT) X-Gm-Message-State: AOAM530RZxZc1+ZVr+fksjk6pMWXNR8h3ROeHHXhaHybNfofqVGkwsCI ib+Ou/JbRZYk0z6jxmbCgN1vkHO69cjsm6U5zmo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kingsquare.nl; s=kingsquare-a; t=1602511292; bh=403bxNt+E/JXFtGuwQGqosh9WNWaOEgG9Bob4pGsIKQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=BhAeZgy9z4a9morwpPYvNOwh1kykUcOq0dPZdZDvLISM/Tkt0xdmTP1OhWcsc8XaA pamk++y7A/8RuGWYv5Pnt4e8lXVvk2FpGgFBUd1PV9FzZpIN+1wokEHlxvAR3o7lmB D8zw+s8ICsPvInKQpcKTi7AeSsfPXrWtm/9l43JQ= X-Google-Smtp-Source: ABdhPJxEfM7qlclwDk9GyPqhiS4ld150ElkWcJK9tDBmAlibwPqN4FwcyV2+HvpBfgVf/ipsXGwmIqOn+wTabulzGso= X-Received: by 2002:a9d:ecf:: with SMTP id 73mr17276481otj.201.1602511291078; Mon, 12 Oct 2020 07:01:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 12 Oct 2020 16:01:20 +0200 X-Gmail-Original-Message-ID: Message-ID: To: "Christoph M. Becker" Cc: Hans Henrik Bergan , PHP internals Content-Type: multipart/alternative; boundary="00000000000040ddd505b179bc30" Subject: Re: [PHP-DEV] Re: want an Object-oriented interface for HashContext From: robin@kingsquare.nl ("Kingsquare.nl - Robin Speekenbrink") --00000000000040ddd505b179bc30 Content-Type: text/plain; charset="UTF-8" Op ma 12 okt. 2020 om 14:55 schreef Christoph M. Becker : > On 12.10.2020 at 13:49, Hans Henrik Bergan wrote: > > > something like > > > > $result = (new > HashContext("SHA1"))->update($str1)->update($str2)->final(); > > > > (userland sample imp: https://3v4l.org/lXd3u ) > > > > I tried asking on the bugtracker ( https://bugs.php.net/bug.php?id=80221 > ) , > > but was told to ask on this mailing list instead. > > Thanks for bringing this up on the mailing list! > > I basically very much support a proper OOP interface, but I think the > method names should use camel-case (e.g. ::updateFile() instead of > ::update_file()), and it might be appropriate to rename ::final() to > ::finalize(). More bikeshedding regarding the method names, and maybe > their signatures might be in order. We do not necessarily have to make > these methods aliases of the existing functions, although that's of > course possible. > > Dear all, As a user/developer of the language itself: it seems to me this is what a package using composer could easily fix right? Does this really have to land in core to be used in the wild? With the proliferation of all the up and coming features and performance improvements it seems to me like these types of improvements using lower level PHP interfaces / native functions have no merit in core itself? (packagist / composer packages don't always have to be full frameworks / large solutions right IMHO) This would also allow the developer to pick and choose a personal style and we don't have to flood the internals with bikeshedding ;) Robin Speekenbrink --00000000000040ddd505b179bc30--