I'm not a specialist Wordpress PHP developer but I'm not understanding this case. I'm passing a flexible via a static function in to the $GLOBALS variable that consists of an assortment. That variable much more the static function is definitely NULL, but prior to it going in it, it's a valid type and prints fine.

functions.php

$badge_Id = get_comment_meta($comment->comment_ID,"badge_id", true);

   if(strlen($badge_Id) > 0) {
        Cisco_Rewards::add_badge_id($badge_id);
                echo $badge_id; // PRINTS PERFECTLY
   }

rewards.php

class Cisco_Rewards {

static function add_badge_id($badge_id) {
        if(count($GLOBALS['badge_ids']) == 0) {
            $GLOBALS['badge_ids'] = array();
        }
        echo $badge_id; // WONT PRINT, IS NULL
        array_push($GLOBALS['badge_ids'], $badge_Id);
        print_r($GLOBALS['badge_ids']); // ALWAYS HAS NULL VALUES
    }

Rather than

if(count($GLOBALS['badge_ids']) == 0) {
  $GLOBALS['badge_ids'] = array();
}
echo $badge_id;

try

var_dump($badge_id); // to check what it contains at the very beginning of the function
if(!is_array($GLOBALS['badge_ids'])) {
  $GLOBALS['badge_ids'] = array();
}