I assume the context here is hashing passwords. Why reimplement what already exists? If you have PHP 5.5, you can take advantage of the new password hashing library, which drastically simplifies the whole process.
If you're running an older version of PHP, I'd use a tried and tested framework, such as phpass.