PHP set_error_handler wierdism with $this

Note, if you are setting an error handler for a class method within your own object, such as
Array( $this'error_handler')
you will effectively make your current object global in scope. Thus, it will only pass out of scope when the script exits or the object manually unset. As a result the deconstructor of your object will not be called. This can be a problem if in your deconstructor you call restore_error_handler.

No related posts.

Leave a Reply

Your email address will not be published. Required fields are marked *

*