|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #1657 New function, similar to include and require, including the environment
Submitted: 1999-07-04 06:39 UTC Modified: 1999-07-04 10:10 UTC
From: A dot Langhorst at itbnet dot de Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 3.0.11 OS: All
Private report: No CVE-ID: None
 [1999-07-04 06:39 UTC] A dot Langhorst at itbnet dot de
I use include() to reduce code inside a script, if st. happens will be included, else it includes In these included pages there a no variables from the origination script available.
I?ve to call EVERY variable from the basic script with $GLOABALS($var); - a function which tells php to use the environment from the originating page would be very useful.
that function should work exactly like include(), but using the environment from the origination script.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1999-07-04 06:47 UTC] A dot Langhorst at itbnet dot de
I forgot to write, that if the included page does inclusions too, it get very much more complicated.
If I want to use variable variables I have to call $$GLOABLS($var) and if the last included page, includes
another page.... it does not take long to see that every second word in the script is $GLOBALS(...)
 [1999-07-04 10:10 UTC] rasmus at cvs dot php dot net
Globals have nothing to do with included files.  Included files use the same variable scope.
The only time you need to use a global is when you are inside a user-defined function.  
Given this, your bug feature request makes absolutely no sense.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 02 08:01:29 2023 UTC