public static function areSameType($value1, $value2): bool
    {
        if (!is_object($value1) || !is_object($value2)) {
            return gettype($value1) === gettype($value2);
        }

        return get_class($value1) === get_class($value2);
    }
public static function areSameType($value1, $value2): bool
    {
        if (!is_object($value1) || !is_object($value2)) {
            return gettype($value1) === gettype($value2);
        }

        return get_class($value1) === get_class($value2);
    }
public static function areSameType ( $ value1 , $ value2 ) : bool { if ( ! is_object ( $ value1 ) || ! is_object ( $ value2 ) ) { return gettype ( $ value1 ) === gettype ( $ value2 ) ; } return get_class ( $ value1 ) === get_class ( $ value2 ) ; }
Checks if two values are the same type

@param mixed $value1 The first value
@param mixed $value2 The second value

@return bool
Checks if two values are the same type