Skip to content

Instantly share code, notes, and snippets.

@hellofromtonya

hellofromtonya/scope.php Secret

Last active Feb 1, 2017
Embed
What would you like to do?
Scope
<?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