Skip to content

Instantly share code, notes, and snippets.

@amrelarabi
Created November 20, 2021 22:04
Show Gist options
  • Save amrelarabi/3336853d2ffac00e2ebc071679441199 to your computer and use it in GitHub Desktop.
Save amrelarabi/3336853d2ffac00e2ebc071679441199 to your computer and use it in GitHub Desktop.
<?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();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment