Using hash_key_equals()
Checking php/pecl/pear modules defined before calling them. Fixes #424