Looks like your problem is that you're trying to set a default from a global. PHP may not like this. You can circumvent it this way:
function fun($con = null){
$con or $con = $GLOBALS['con'];
}
I personally think this is kind of hokey. It looks like you're wanting to get a DB connection from a global resource. I don't think that's how this should be done, but this answer would allow $con to be set from global if not passed to the function. Or allow it to be used if passed.