Add hex2bin replacement for php <= 5.3 from @atans