[ create a new paste ] login | about

Link: http://codepad.org/2sibu2JL    [ raw code | output | fork ]

upwhere - PHP, pasted on Jan 18:
1
2
3
4
5
6
7
8
9
10
11
<?php
function test() {
    $foo = "local variable";
 
    echo '$foo in global scope: ' . $GLOBALS["foo"] . "\n";
    echo '$foo in current scope: ' . $foo . "\n";
}
 
$foo = "Example content";
test();
?>


Output:
1
2
$foo in global scope: Example content
$foo in current scope: local variable


Create a new paste based on this one


Comments: