Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122268 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 60446 invoked from network); 31 Jan 2024 00:34:37 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 31 Jan 2024 00:34:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1706661325; bh=tKF+5XhEttHL5CZT2O65A6VfZepdWKZT1UU49vlv4Ak=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=I8XmO+7uUzg4PPgzdWdZR/9etsQ5NaT+r/d1s4yWht/VxS6a2/MgBb/4xcrFjFSrE MdosxxMisVdcSKjj6+DsKxKQlcWFSXhgXECYCT1K63ZIjqZYJWhdVgn7MvsT2ZfJqp SzxQj4qcp67kfCXg69MQvNf7cB3jaBWTD0CzhXmfJMPbLK0Kam6y8TVTR6j65mRZsz i2f0JGfK7799VZe3fKMgK7Kmkx9dhK/GaLpr3jr7HddP0M71MK0BB22OKMuaqbFQnL LcUdPa1f1AvC+J1o/SsmujSGy2PwzGiGrT3kfJZu7Z0IFtnfyreJm8yrVFKaV9peSJ 6vhNHumoExdBw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 79C3C18005A for ; Tue, 30 Jan 2024 16:35:23 -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=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-4323.proton.ch (mail-4323.proton.ch [185.70.43.23]) (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 ; Tue, 30 Jan 2024 16:35:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail; t=1706661272; x=1706920472; bh=tKF+5XhEttHL5CZT2O65A6VfZepdWKZT1UU49vlv4Ak=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=IioZ3eRxl9kC3HqMYk7TyRWZR+4XSEhlNjQGQuZCD6pr8veGKmncpdbUX3Moe4Ob6 C2ZZuO6t2Z1aPAcvK7NFuvkQ2i7OXwZlb4kAtt+Vmgup5MAyhkqscRX+dArrkwZe3u Kh9yybASwWdWBC4o68sM8HaDm2szGI2Ta/6i47dSoH2hr/oAn9CBDg36Ihva3wzu2H MdxZnNZCIgbotI3oyL1o3tVhv9YnTqoLnaTqLUomQ0ZgqqcjVq+ei0aP7lH6uDRzCc nI9qxFhbsFO4RAUGJ8fYadL5VS9ZfRJPDeyoXHiooHR/wZxP3dL2LM32ExW/xUV5Q4 Wb4pvGkXZnE7Q== Date: Wed, 31 Jan 2024 00:34:04 +0000 To: Nicolas Grekas Cc: "internals@lists.php.net" Message-ID: In-Reply-To: References: Feedback-ID: 96993444:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Add http_(get|clear)_last_request_headers() function From: internals@gpb.moe ("Gina P. Banyard") On Tuesday, 30 January 2024 at 08:48, Nicolas Grekas wrote: >=20 > In Symfony's HttpClient, we use stream_get_meta_data($h)['wrapper_data'] = to > access headers, so there is already a way to get them using nothing but > local scope. >=20 > This makes me wonder why, in "rejected ideas", you wrote this? >=20 > > One suggested idea was to provide those headers via a by-reference entr= y > > to the stream context. >=20 >=20 >=20 > Maybe we don't need anything but to promote what works already (this > "wrapper_data" entry)? The issue is this requires you to have a stream in the first place. file_get_contents() doesn't return a stream, and if the request fails fopen= (), by default, returns false. If you do have a stream, then yes stream_get_meta_data() is better, but the= objective of this addition is to replace the $http_request_header variable= so that it can be removed. This is a rather fringe feature, and thus I expect these functions to also = be a fringe feature. Best regards, Gina P. Banyard