Function giving me trouble

What I can do:
function createDir($path = ‘/path/to/root/’)

What I need to do:
$server_root = $_SERVER[‘DOCUMENT_ROOT’];
function createDir($path = $server_root)

or this:
function createDir($path = dirname($_SERVER[‘SCRIPT_NAME’]))

Why don’t you just pass it in when you execute the function as from memory there is no way to pass variables or functions as part of a argument value from outside the function scope.