voku\helper\Bootup::is_php PHP Méthode

is_php() public static méthode

Determines if the current version of PHP is equal to or greater than the supplied value.
public static is_php ( string $version ) : boolean
$version string
Résultat boolean

Return true if the current version is $version or higher

    public static function is_php($version)
    {
        static $_is_php;
        $version = (string) $version;
        if (!isset($_is_php[$version])) {
            $_is_php[$version] = version_compare(PHP_VERSION, $version, '>=');
        }
        return $_is_php[$version];
    }

Usage Example

Exemple #1
0
 /**
  * Format a number with grouped thousands
  *
  * @param float  $number
  * @param int    $decimals
  * @param string $dec_point
  * @param string $thousands_sep
  *
  * @return string
  */
 public static function number_format($number, $decimals = 0, $dec_point = '.', $thousands_sep = ',')
 {
     if (Bootup::is_php('5.4') === true) {
         if (isset($thousands_sep[1]) || isset($dec_point[1])) {
             return str_replace(array('.', ','), array($dec_point, $thousands_sep), number_format($number, $decimals, '.', ','));
         }
     }
     return number_format($number, $decimals, $dec_point, $thousands_sep);
 }
All Usage Examples Of voku\helper\Bootup::is_php