Generic utils for php.