Created
January 31, 2014 18:52
-
-
Save jwigal/8740536 to your computer and use it in GitHub Desktop.
global scope isn't global any more...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$global1 = "boo!"; | |
function outer(){ | |
global $global1; | |
$global2 = "ya!"; | |
echo "<p>outer says global1 is $global1</p>"; | |
function inner(){ | |
global $global1, $global2; | |
echo "<p>inner says global1: $global1, global2: $global2</p>"; | |
} | |
inner(); | |
} | |
outer(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment