Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121845 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 71679 invoked from network); 29 Nov 2023 02:59:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Nov 2023 02:59:23 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A5CBA18002B for ; Tue, 28 Nov 2023 18:59:29 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (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, 28 Nov 2023 18:59:29 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id C96883200B77 for ; Tue, 28 Nov 2023 21:59:15 -0500 (EST) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Tue, 28 Nov 2023 21:59:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1701226755; x= 1701313155; bh=fY1tfVWymcf77guj9vy2DOxdVoKSznWBhDpBFBgVNEQ=; b=Q wG+Zy/is3Sn6JUh5y8dHHtVow1nQAbZnFkc1iI5OzjFrPQFDAHWJENoB7ExjLzg3 SXgtzNahmzAdBI2L/Y2drjUhHwVmqQbj1LTvKo4O7oiyUdhqD2y1yb0UKWbVBHdU Jb7wo+StegD+XDgftRVre9bh/4UUvUNgGpaY9KhJXPH5k3mycC2DiDgQS+s7034z cThbZHNbvie5AJVMLnFgbhVf3nJqxLJgXHCAndwj3b6VlIznvNzh6P/DAWUsR/Hq Z7gUV3gaewQ4N1VJwn0q4bRSaI0Q5SO4iTOECJ8voNI6bZ2AnwRwUycUj3Ln25at l1INSZN/rWcxDrfq4WpMQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1701226755; x=1701313155; bh=fY1tfVWymcf77 guj9vy2DOxdVoKSznWBhDpBFBgVNEQ=; b=ff41wQLiYFnPLAIzKUc5VDiMWG2/p MzGuRrit3VbH2jkG4VOxAy0+8yc+YPRMgFWYQ0bqMYcCwJAp7kKMcPrGdIjZCU2h P3AIYcP+JIzbuFWBWJy6sADcyWiVR9KOCgfBObYq3peeBtA+sjCngEGW0qqz6UkL fKB1hcElbx2zvVW5ONMMBOmRTQbYmG5jp+TdnBinUKnWu6CbDAgAlPYHn920f3bQ g+O8LyOB+oP5Re9uR8V3V9dYsyYCvWxtX5Di/lRsQcF8iNBQ+OysrJPJqRMFusXD B44MT/VrGWmkHMXfVqx+HvgMLDpsbHItLNeqDO75dqsN6q/yWrBWkbAbg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeigedghedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeeglefgkeduiedvvdetffeujefftdfhjeeiveehgfff keduveektddvledvvdfffeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id D23DD1700089; Tue, 28 Nov 2023 21:59:14 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1234-gac66594aae-fm-20231122.001-gac66594a MIME-Version: 1.0 Message-ID: <34dada8e-7f2a-4d94-b7df-d9d3c7b2f3ce@app.fastmail.com> In-Reply-To: <6566989F.7010305@adviesenzo.nl> References: <6566989F.7010305@adviesenzo.nl> Date: Tue, 28 Nov 2023 20:58:54 -0600 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] What is the prevailing sentiment about extract() and compact() ? From: larry@garfieldtech.com ("Larry Garfield") On Tue, Nov 28, 2023, at 7:49 PM, Juliette Reinders Folmer wrote: > L.S., > > What with all the drives towards cleaner code, how do people feel > nowadays about `extract()` and `compact()` still being supported ? > > Both have alternatives. The alternatives may be a little more cumbersome > to type, but also make the code more descriptive, lessens the risk of > variable name collisions (though this can be handled via the $flags in > extract), prevents surprises when a non-associative key would be > included in an array and lessens security risks when used on untrusted data *snip* > I can imagine these could be candidates for deprecation ? Or limited > deprecation - only when used in the global namespace ? > > For now, I'm just wondering how people feel about these functions. > > Smile, > Juliette extract() has very limited use in some kinds of template engine, which use PHP require() as a template mechanism. I don't think compact() has any uses. I very recently was just reminded that these even exist, as i had to tell one of my developers to not use them. I think it was compact() he was trying to use. I vetoed it. I would not mind if they were removed, but I don't know how large the BC impact would be. They'd probably need a long deprecation period, just to be safe. --Larry Garfield