title: Returning null instead of an array
body: <p>I have a cart class that returns the products in a users cart</p>
  
  <p><code>cart.class.php</code></p>
  
  <pre><code>    public static function getItems()
      {
          if(!isset($_SESSION["cart"]["products"]))
          {
              return array(); 
          }
          else
          {
              return $_SESSION["cart"]["products"];
          }
      }
  </code></pre>
  
  <p>This is the code to get the cart and display it on the page</p>
  
  <pre><code>if($action == "getCart")
  {       
      echo json_encode(Cart::getItems());
  
      exit;
  }
  </code></pre>
  
  <p>When I'm testing the code on my localhost, it returns <code>[]</code> (Empty) but on my website it returns <code>null</code>. What have I done wrong?</p>