you should sue ``restore_error_handler`` instead of ``set_error_handler($previous)``