note 95106 added to function.get-defined-vars
| From: | randallgirard at hotmail dot com | Date: | Mon, 14 Dec 2009 08:11:18 +0000 |
| Subject: | note 95106 added to function.get-defined-vars | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-163914@lists.php.net to get a copy of this message | ||
The documentation states that $GLOBALS is included in the list. However, it does not appear to do so
under PHP 5.3.0. Perhaps this was updated in the new version and the documentation was not?
<?php
function foobar( $foo=NULL, $bar=NULL ) {
var_dump(array_keys(get_defined_vars()));
}
foobar();
?>
I get the following output:
array(2) {
[0]=>
string(3) "foo"
[1]=>
string(3) "bar"
}
----
Server IP: 208.69.120.55
Probable Submitter: 76.167.60.11
----
Manual Page -- http://www.php.net/manual/en/function.get-defined-vars.php
Edit -- https://master.php.net/note/edit/95106
Del: integrated -- https://master.php.net/note/delete/95106/integrated
Del: useless -- https://master.php.net/note/delete/95106/useless
Del: bad code -- https://master.php.net/note/delete/95106/bad+code
Del: spam -- https://master.php.net/note/delete/95106/spam
Del: non-english -- https://master.php.net/note/delete/95106/non-english
Del: in docs -- https://master.php.net/note/delete/95106/in+docs
Del: other reasons-- https://master.php.net/note/delete/95106
Reject -- https://master.php.net/note/reject/95106
Search -- https://master.php.net/manage/user-notes.php