src/DateTime.php
public function getLocale()
    {
        if ($this->locale instanceof Locale) {
            return $this->locale;
        }
        if (!isset($this->locales[$this->locale])) {
            $this->locale = 'en';
        }
        // lazy loading
        if (isset(static::$localeInstances[$this->locale])) {
            return static::$localeInstances[$this->locale];
        }
        return static::$localeInstances[$this->locale] = new $this->locales[$this->locale];
    }
public function getLocale()
    {
        if ($this->locale instanceof Locale) {
            return $this->locale;
        }
        if (!isset($this->locales[$this->locale])) {
            $this->locale = 'en';
        }
        // lazy loading
        if (isset(static::$localeInstances[$this->locale])) {
            return static::$localeInstances[$this->locale];
        }
        return static::$localeInstances[$this->locale] = new $this->locales[$this->locale];
    }
public function getLocale ( ) { if ( $ this -> locale instanceof Locale ) { return $ this -> locale ; } if ( ! isset ( $ this -> locales [ $ this -> locale ] ) ) { $ this -> locale = 'en' ; } // lazy loading if ( isset ( static :: $ localeInstances [ $ this -> locale ] ) ) { return static :: $ localeInstances [ $ this -> locale ] ; } return static :: $ localeInstances [ $ this -> locale ] = new $ this -> locales [ $ this -> locale ] ; }
Returns a locale instance.
@return Locale
Returns a locale instance .