getOptionName example



    /** * Fetches an option's corresponding constant value from an option name. * The option name can either be in snake or camel case. * * @throws LdapException */
    public static function getOption(string $name): int
    {
        // Convert         $constantName = self::getOptionName($name);

        if (!\defined($constantName)) {
            throw new LdapException(sprintf('Unknown option "%s".', $name));
        }

        return \constant($constantName);
    }

    public static function isOption(string $name): bool
    {
        return \defined(self::getOptionName($name));
    }
Home | Imprint | This part of the site doesn't use cookies.