php.net |  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 page1.inc will be included, else it includes page2.inc. 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.
ie.
that function should work exactly like include(), but using the environment from the origination script.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 21:01:30 2024 UTC