Bug #14393: Function calling filename built-in access
| From: | foobardotcom at poczta dot onet dot pl | Date: | Sun, 09 Dec 2001 15:35:34 +0000 |
| Subject: | Bug #14393: Function calling filename built-in access | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-73149@lists.php.net to get a copy of this message | ||
From: foobardotcom@poczta.onet.pl
Operating system: all
PHP version: 4.1.0
PHP Bug Type: Feature/Change Request
Bug description: Function calling filename built-in access
Create function, that will not constraint specifying __FILE__ who is
calling it.
function vote($num) {
global $votes;
$votes[@func_get_caller()] += $num;
}
// 1.php: vote(5);
// 2.php: vote(3);
// all.php:
include("1.php");
include("2.php");
print_r($votes);
// should show array: array([1.php] => 5, [2.php] => 3)
// but without this function will show: array([0] => 8)
--
Edit bug report at: http://bugs.php.net/?id=14393&edit=1