-
-
Save hellofromtonya/51f2c8027d371e155901d359a6a0064f to your computer and use it in GitHub Desktop.
Scope
This file contains 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 | |
$global_variable = 'I am a global variable'; | |
d( $global_variable ); | |
function test_scope( $local_variable ) { | |
$local_variable .= ' I am only accessible to my function!'; | |
echo '========= in the test_scope function ========'; | |
d( $local_variable ); | |
d( $global_variable ); | |
} | |
//test_scope( 'testing from global space' ); | |
d( $local_variable ); | |
ddd( $global_variable ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment