Re: [RFC] Import of variables

From: Date: Sun, 09 Aug 2020 22:12:48 +0000
Subject: Re: [RFC] Import of variables
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-111409@lists.php.net to get a copy of this message
Hi, David. Thanks ---- En dom, 09 ago 2020 16:58:41 +0200 David Rodrigues <david.proweb@gmail.com> escribió ---- > I suggests to make something like Node does: import "file.php" ($a, $b) so $a and $b > must be extracted from file.php context. All other variables should be ignored. > Or, to avoid create more complexity and possible new keywords to import syntax, maybe create a > new function: > importx(string $file, ?array $extract = null) and requirex(...) (importx and requirex is only > pseudo) That is a good idea!. However, in some framworks/CMS you don't have control about include/require. :( Regards

« previous php.internals (#111409) next »