public static function comparison($check1, $operator, $check2)
    {
        if ((float)$check1 != $check1) {
            return false;
        }

        $message = 'Operator `%s` is deprecated, use constant `Validation::%s` instead.';

        $operator = str_replace([' ', "\t", "\n", "\r", "\0", "\x0B"], '', strtolower($operator));
        switch ($operator) {
            case 'isgreater':
                /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_GREATER instead.
                 */
                deprecationWarning(sprintf($message, $operator, 'COMPARE_GREATER'));
                // no break
            case static::COMPARE_GREATER:
                if ($check1 > $check2) {
                    return true;
                }
                break;
            case 'isless':
                /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_LESS instead.
                 */
                deprecationWarning(sprintf($message, $operator, 'COMPARE_LESS'));
                // no break
            case static::COMPARE_LESS:
                if ($check1 < $check2) {
                    return true;
                }
                break;
            case 'greaterorequal':
                /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_GREATER_OR_EQUAL instead.
                 */
                deprecationWarning(sprintf($message, $operator, 'COMPARE_GREATER_OR_EQUAL'));
                // no break
            case static::COMPARE_GREATER_OR_EQUAL:
                if ($check1 >= $check2) {
                    return true;
                }
                break;
            case 'lessorequal':
                /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_LESS_OR_EQUAL instead.
                 */
                deprecationWarning(sprintf($message, $operator, 'COMPARE_LESS_OR_EQUAL'));
                // no break
            case static::COMPARE_LESS_OR_EQUAL:
                if ($check1 <= $check2) {
                    return true;
                }
                break;
            case 'equalto':
                /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_EQUAL instead.
                 */
                deprecationWarning(sprintf($message, $operator, 'COMPARE_EQUAL'));
                // no break
            case static::COMPARE_EQUAL:
                if ($check1 == $check2) {
                    return true;
                }
                break;
            case 'notequal':
                /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_NOT_EQUAL instead.
                 */
                deprecationWarning(sprintf($message, $operator, 'COMPARE_NOT_EQUAL'));
                // no break
            case static::COMPARE_NOT_EQUAL:
                if ($check1 != $check2) {
                    return true;
                }
                break;
            case static::COMPARE_SAME:
                if ($check1 === $check2) {
                    return true;
                }
                break;
            case static::COMPARE_NOT_SAME:
                if ($check1 !== $check2) {
                    return true;
                }
                break;
            default:
                static::$errors[] = 'You must define the $operator parameter for Validation::comparison()';
        }

        return false;
    }
public static function comparison($check1, $operator, $check2)
    {
        if ((float)$check1 != $check1) {
            return false;
        }

        $message = 'Operator `%s` is deprecated, use constant `Validation::%s` instead.';

        $operator = str_replace([' ', "\t", "\n", "\r", "\0", "\x0B"], '', strtolower($operator));
        switch ($operator) {
            case 'isgreater':
                /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_GREATER instead.
                 */
                deprecationWarning(sprintf($message, $operator, 'COMPARE_GREATER'));
                // no break
            case static::COMPARE_GREATER:
                if ($check1 > $check2) {
                    return true;
                }
                break;
            case 'isless':
                /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_LESS instead.
                 */
                deprecationWarning(sprintf($message, $operator, 'COMPARE_LESS'));
                // no break
            case static::COMPARE_LESS:
                if ($check1 < $check2) {
                    return true;
                }
                break;
            case 'greaterorequal':
                /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_GREATER_OR_EQUAL instead.
                 */
                deprecationWarning(sprintf($message, $operator, 'COMPARE_GREATER_OR_EQUAL'));
                // no break
            case static::COMPARE_GREATER_OR_EQUAL:
                if ($check1 >= $check2) {
                    return true;
                }
                break;
            case 'lessorequal':
                /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_LESS_OR_EQUAL instead.
                 */
                deprecationWarning(sprintf($message, $operator, 'COMPARE_LESS_OR_EQUAL'));
                // no break
            case static::COMPARE_LESS_OR_EQUAL:
                if ($check1 <= $check2) {
                    return true;
                }
                break;
            case 'equalto':
                /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_EQUAL instead.
                 */
                deprecationWarning(sprintf($message, $operator, 'COMPARE_EQUAL'));
                // no break
            case static::COMPARE_EQUAL:
                if ($check1 == $check2) {
                    return true;
                }
                break;
            case 'notequal':
                /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_NOT_EQUAL instead.
                 */
                deprecationWarning(sprintf($message, $operator, 'COMPARE_NOT_EQUAL'));
                // no break
            case static::COMPARE_NOT_EQUAL:
                if ($check1 != $check2) {
                    return true;
                }
                break;
            case static::COMPARE_SAME:
                if ($check1 === $check2) {
                    return true;
                }
                break;
            case static::COMPARE_NOT_SAME:
                if ($check1 !== $check2) {
                    return true;
                }
                break;
            default:
                static::$errors[] = 'You must define the $operator parameter for Validation::comparison()';
        }

        return false;
    }
public static function comparison ( $ check1 , $ operator , $ check2 ) { if ( ( float ) $ check1 != $ check1 ) { return false ; } $ message = 'Operator `%s` is deprecated, use constant `Validation::%s` instead.' ; $ operator = str_replace ( [ ' ' , "\t" , "\n" , "\r" , "\0" , "\x0B" ] , '' , strtolower ( $ operator ) ) ; switch ( $ operator ) { case 'isgreater' : /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_GREATER instead.
                 */ deprecationWarning ( sprintf ( $ message , $ operator , 'COMPARE_GREATER' ) ) ; // no break case static :: COMPARE_GREATER : if ( $ check1 > $ check2 ) { return true ; } break ; case 'isless' : /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_LESS instead.
                 */ deprecationWarning ( sprintf ( $ message , $ operator , 'COMPARE_LESS' ) ) ; // no break case static :: COMPARE_LESS : if ( $ check1 < $ check2 ) { return true ; } break ; case 'greaterorequal' : /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_GREATER_OR_EQUAL instead.
                 */ deprecationWarning ( sprintf ( $ message , $ operator , 'COMPARE_GREATER_OR_EQUAL' ) ) ; // no break case static :: COMPARE_GREATER_OR_EQUAL : if ( $ check1 >= $ check2 ) { return true ; } break ; case 'lessorequal' : /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_LESS_OR_EQUAL instead.
                 */ deprecationWarning ( sprintf ( $ message , $ operator , 'COMPARE_LESS_OR_EQUAL' ) ) ; // no break case static :: COMPARE_LESS_OR_EQUAL : if ( $ check1 <= $ check2 ) { return true ; } break ; case 'equalto' : /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_EQUAL instead.
                 */ deprecationWarning ( sprintf ( $ message , $ operator , 'COMPARE_EQUAL' ) ) ; // no break case static :: COMPARE_EQUAL : if ( $ check1 == $ check2 ) { return true ; } break ; case 'notequal' : /*
                 * @deprecated 3.6.0 Use Validation::COMPARE_NOT_EQUAL instead.
                 */ deprecationWarning ( sprintf ( $ message , $ operator , 'COMPARE_NOT_EQUAL' ) ) ; // no break case static :: COMPARE_NOT_EQUAL : if ( $ check1 != $ check2 ) { return true ; } break ; case static :: COMPARE_SAME : if ( $ check1 === $ check2 ) { return true ; } break ; case static :: COMPARE_NOT_SAME : if ( $ check1 !== $ check2 ) { return true ; } break ; default : static :: $ errors [ ] = 'You must define the $operator parameter for Validation::comparison()' ; } return false ; }
Used to compare 2 numeric values.

@param string $check1 The left value to compare.
@param string $operator Can be either a word or operand
is greater >, is less <, greater or equal >=
less or equal <=, is less <, equal to ==, not equal !=
@param int $check2 The right value to compare.
@return bool Success
Used to compare 2 numeric values .