When developping a module, we often use some commonly used PHP functions. As you may not know Drupal provides some overrides for these functions. They are often related to strings, they have the same name as their PHP native equivalent except that they are prefixed with drupal_. Here is a list of PHP functions you should replace with its Drupal equivalent:
strlen() with drupal_strlen()strtoupper() with drupal_strtoupper()strtolower() with drupal_strtolower()ucfirst() with drupal_ucfirst()substr() with drupal_substr()eval() with drupal_eval()clone with drupal_clone()For more on this, you should read includes/unicode.inc and includes/common.inc.