2

My question is similar to this one. However, the error control operator does not work for me.

With the following code:

$this->fp = @fsockopen($this->ip, $this->port, $errno, $errstr, $this->timeout);

I still get an error message:

fsockopen(): unable to connect to xxx.xxx.xxx.xx:xxxxx (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. )

Is it possible that I can have error control operators disabled?

Community
  • 1
  • 1
vandiedakaf
  • 514
  • 1
  • 6
  • 18

1 Answers1

3

I found the problem! I've been using my own error handler

set_error_handler('my_error_handler');

and it prints out the errors irregardless if @ has been prefixed or not.

FYI - code from the php manual demonstrates how errors can be suppressed within a user defined error handler:

// if error has been supressed with an @
if (error_reporting() == 0) {
    return;
}
vandiedakaf
  • 514
  • 1
  • 6
  • 18