<?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 );