php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #14712 allways global scope
Submitted: 2001-12-27 02:10 UTC Modified: 2002-04-28 20:02 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: roberto at berto dot net Assigned:
Status: Duplicate Package: Feature/Change Request
PHP Version: 4.1.0 OS: all
Private report: No CVE-ID: None
 [2001-12-27 02:10 UTC] roberto at berto dot net
Will be cool if a new language constructor set global scope to a variable, like $_REQUEST, $_POST, etc.

This "forever global" constructor should work with every type of variable (array,object,resource,string, etc)

So,

<?PHP

$smarty->template_dir = "/lib/here/";
forever $smarty;

function something() {
// output "/lib/here";
 print $smarty->template_dir;
}

// output "/lib/here";
 print $smarty->template_dir;

class foo {
function other () {
// output "/lib/here";
 print $smarty->template_dir;

}
}

Thanx.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-28 20:02 UTC] jimw@php.net
duplicate of #12669.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 13 05:01:27 2024 UTC