Accessing an instanciated class

I’ve done something like that:

<?php


class Cart {
    protected static $_instance = null;

    public static function instance() {
        if ( is_null( self::$_instance ) ) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }
    //....
}

$cart = new Cart();
$cart->init();

function EVA_Cart() {
    return Cart::instance();
}

function deposit_total(){
    $cart = EVA_Cart();
    $totals = array_sum( $cart->deposits );
    return wc_price( $totals );
}

Is it the best way ?