Created
August 22, 2013 09:02
-
-
Save satgo1546/6304802 to your computer and use it in GitHub Desktop.
PHP中奇葩的变量作用域……
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 | |
$a = 1; | |
function f() { | |
echo "Function / \$a : $a"; | |
} | |
echo "Global / \$a : $a"; | |
f(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment