public function asciiPrintable($subject) : bool
    {
        if ($subject === null) {
            return false;
        }
        $v = '' . $subject;
        if ($v === '') {
            return true;
        }
        // filter_var() is not so picky about it's return value :-(
        if (
            !($filtered = filter_var($v, FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH))
            || !is_string($filtered)
        ) {
            return false;
        }
        return !strcmp($v, $filtered)
            // Prefix space to avoid expensive type check (boolean false).
            && !strpos(' ' . $v, chr(127));
    }
public function asciiPrintable($subject) : bool
    {
        if ($subject === null) {
            return false;
        }
        $v = '' . $subject;
        if ($v === '') {
            return true;
        }
        // filter_var() is not so picky about it's return value :-(
        if (
            !($filtered = filter_var($v, FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH))
            || !is_string($filtered)
        ) {
            return false;
        }
        return !strcmp($v, $filtered)
            // Prefix space to avoid expensive type check (boolean false).
            && !strpos(' ' . $v, chr(127));
    }
public function asciiPrintable ( $ subject ) : bool { if ( $ subject === null ) { return false ; } $ v = '' . $ subject ; if ( $ v === '' ) { return true ; } // filter_var() is not so picky about it's return value :-( if ( ! ( $ filtered = filter_var ( $ v , FILTER_UNSAFE_RAW , FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH ) ) || ! is_string ( $ filtered ) ) { return false ; } return ! strcmp ( $ v , $ filtered ) // Prefix space to avoid expensive type check (boolean false). && ! strpos ( ' ' . $ v , chr ( 127 ) ) ; }
Allows ASCII except lower ASCII and DEL.

NB: Returns true on empty ('') string.

@see Validate::string()

@param mixed $subject
Checked stringified.

@return bool
True on empty.
Allows ASCII except lower ASCII and DEL .