Thanks for this @rubensargsyan!

A couple things - we can't use anonymous functions until WordPress requires PHP 5.3 as a minimum.  The passing of $class by reference here is also unnecessary, but that's besides the point.

I'd recommend something more along the lines of `$classes_array = array_walk( explode( ' ', $classes ), 'sanitize_html_class' );` and then implode it.