platform/Php.php
public static function hasFlag(string $flag) : bool
    {
        // Standardize the flag name - remove starting hyphens.
        $flag = ltrim($flag, '-');

        // Return the check right away if it's already cached.
        if (isset(static::$flags[$flag])) {
            return static::$flags[$flag];
        }

        // Grab the output of phpinfo(). If INFO_ALL is already available, we will just parse it instead of
        // fetching INFO_GENERAL specifically for our case. Then we are simply going to check if the --string
        // appears in the info.
        $result = strpos(static::$info[INFO_ALL] ?? static::getInfo(INFO_GENERAL), '--'.$flag);

        // Cache the result and return it.
        return static::$flags[$flag] = false !== $result;
    }
public static function hasFlag(string $flag) : bool
    {
        // Standardize the flag name - remove starting hyphens.
        $flag = ltrim($flag, '-');

        // Return the check right away if it's already cached.
        if (isset(static::$flags[$flag])) {
            return static::$flags[$flag];
        }

        // Grab the output of phpinfo(). If INFO_ALL is already available, we will just parse it instead of
        // fetching INFO_GENERAL specifically for our case. Then we are simply going to check if the --string
        // appears in the info.
        $result = strpos(static::$info[INFO_ALL] ?? static::getInfo(INFO_GENERAL), '--'.$flag);

        // Cache the result and return it.
        return static::$flags[$flag] = false !== $result;
    }
public static function hasFlag ( string $ flag ) : bool { // Standardize the flag name - remove starting hyphens. $ flag = ltrim ( $ flag , '-' ) ; // Return the check right away if it's already cached. if ( isset ( static :: $ flags [ $ flag ] ) ) { return static :: $ flags [ $ flag ] ; } // Grab the output of phpinfo(). If INFO_ALL is already available, we will just parse it instead of // fetching INFO_GENERAL specifically for our case. Then we are simply going to check if the --string // appears in the info. $ result = strpos ( static :: $ info [ INFO_ALL ] ?? static :: getInfo ( INFO_GENERAL ) , '--' . $ flag ) ; // Cache the result and return it. return static :: $ flags [ $ flag ] = false !== $ result ; }
Checks whether PHP has been compiled with the given flag.

@param   string  $flag   The name of the flag to check. The two initial hyphens can be omitted.
@return  bool            True when PHP has been compiled with the given flag, false otherwise.
Checks whether PHP has been compiled with the given flag .