Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122187 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 42593 invoked from network); 19 Jan 2024 11:10:34 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Jan 2024 11:10:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1705662674; bh=oXuf3XcXQZDbHyteCvpCk/nbJiY8I/Ksyp5gK9UqyW0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=OTub2kRccf4hA8yqF56Ra6YvCXAP2OWAeDIpWbyPUyqXb2DM1yE2aY25evf+xDze0 LBdBHXZJ8rg0PCpYI7Z8vD57MMtbzl69uuc/ZaZn27xwx7TKzh0rl487clrJ6/lIWq 7F4qHY0BUhxjKgZHMYEKu49Rb58S0dxUfPoLAuoVwdGUoUeVS5h3L32O1nwugToWk/ czoWVg965N/QMwYUVUBIvfyYTQxEJSGY+omgdfPT4KAIP/taviCudWq+yUHtTYziAL fY4m2AUp1//XyMILq5HNz4VmGqYC1eGGA9RaZFerbY7oVb5i8Aju2zBPd9U0Mgmk0X Ej44YNnCMhe0w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 05820180066 for ; Fri, 19 Jan 2024 03:11:14 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DMARC_MISSING, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 19 Jan 2024 03:11:13 -0800 (PST) Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-559edcee47eso619018a12.0 for ; Fri, 19 Jan 2024 03:10:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705662631; x=1706267431; 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=oXuf3XcXQZDbHyteCvpCk/nbJiY8I/Ksyp5gK9UqyW0=; b=Ver3LY4017SC161r8x5GeYIYoN1TS0bxciZw8mzrEzEzEXaKGnClLF3V74neCdDLA5 JZfgjG+O9mMJFU8OoFcHn5FfXhhEy0B9eSisFObjOpDqwjt7yAYT4WAAI7VFQsIc63gl xxlNEYBaOQLVDQaUEF/jiF2/xPsLP0HqPgyEU4W9QxVR6kROEnISTsXJfjVbjw7+ljzL RHcfBiLs9AOl695KNZ2xZYal9BW2IA4GlmcHuQ9E0+oVBar+cr63aN0nNTs8EHU78dEA Ba1j6unmwLKDW/bmA/qibSsdj2VRVob0NNsuxkxrMmSKC9xFgt/0/umBX6LYjhJGPUNb bbdg== X-Gm-Message-State: AOJu0Yx7Wlr5DO9oevqOT7380SV96vtUfzRQylZCK45DZewQavP1fKfB t5VitkoyByX3x0yizRLv9u92NIhq1OXrvoLFPRLfIlwqJONEC2DYroWLSDmTs9EgIIgF9iUn4Hk gyOA+lEVavzXlrcy7fZ3SEnr3ipw= X-Google-Smtp-Source: AGHT+IEh6mMQAQ3N8sK6pQpCqml0I/E5GSiwRgRu5KFzDPS/BowTXHjOtQion4jKgcfqyHvgE50JtU6DskEiVAkyzOs= X-Received: by 2002:a17:906:d11a:b0:a2d:9c52:bc2 with SMTP id b26-20020a170906d11a00b00a2d9c520bc2mr1394396ejz.18.1705662631058; Fri, 19 Jan 2024 03:10:31 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 19 Jan 2024 11:10:19 +0000 Message-ID: To: =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= Cc: PHP Internals List Content-Type: multipart/alternative; boundary="0000000000003b22e7060f4a87c5" Subject: Re: [PHP-DEV] Dedicated StreamBucket class From: bukka@php.net (Jakub Zelenka) --0000000000003b22e7060f4a87c5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Wed, Jan 17, 2024 at 9:14=E2=80=AFPM M=C3=A1t=C3=A9 Kocsis wrote: > I just submitted feedback to the PR but will also mention it here as it's >> probably more an API thing. The problem that I see is that it combines t= wo >> distinct things and create quite ugly self reference inside the proposed >> StreamBucket object. I would prefer we split it and introduce >> StreamBucketHandle opaque object that will completely replace the curren= t >> use of bucket resource. The actual StreamBucket could be introduced late= r >> (ideally in PHP 9 as it's a sort of breaking change - change of class). >> > > I agree with using a two step migration approach, and that's why I only > changed one part for now: > the containing object, leaving its resource property intact. However, as > far as I can tell, > there's no need to create a separate StreamBucketHandle object when > migrating the stream bucket resource to an > object, but we could inline it directly into the containing StreamBucket > object. I'm saying this because the > stream bucket resource property is only used by two functions: > stream_bucket_append() and stream_bucket_prepend(), > and I cannot imagine any other use-case where having a > StreamBucket::$bucket property would be useful (but correct > me if I'm wrong, I'm not the most experienced with stream buckets). > > I read again the PR and not sure why I thought that it's supposed to replace the bucket resource as it's just about replacing stdClass with StreamBucket. The thing that probably confused me is that the actual stream bucket is just a property $bucket in that object currently (resource handle) and not the wrapping object that you are changing. I kind of imagined to do it other way round but maybe this makes more sense. > I think it's more typing issue if someone passes this object for further >> processing and type hint stdClass. Possibly the pattern above could be u= sed >> for copying but seems quite unlikely. Still I would see this as a BC bre= ak >> and it is not really related to resource to object migration. >> > > For me, it seems like a subtle edge case which could be addressed by > explicitly mentioning the change in the UPGRADING file. > But I got your point, and I'm ok to submit an RFC. > > The only issue that I see that if you migrate the resource to object you effectively drop that property which might be a BC break but based on the recent RFC results it will happen in PHP 9.0 so it's not such a big issue. I think this might be actually an opportunity to deprecate the usage of that property. So if this targeted 8.4, then it would allow us to keep the $bucket property there but also deprecate its accessing so users can migrate the unlikely use of this property. Other option would be to keep the property a an object self-reference but that would be pointless and not nice. I think the RFC should be done for this though. Regards Jakub --0000000000003b22e7060f4a87c5--