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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: roberto at berto dot net
New email:
PHP Version: OS:

 

 [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: Sat Dec 21 11:01:30 2024 UTC