Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6587427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:54:55+00:00 2026-05-25T16:54:55+00:00

Context: I have three environments for an app: dev (local), test/staging (prod server), production.

  • 0

Context:

I have three environments for an app: dev (local), test/staging (prod server), production. The app knows which is which. Error reporting on both staging and production is 0, so errors are never shown. On dev I want to see errors immediately and I want to see them where they happen, so not in some log, but in the code’s result.

However, I don’t want to see the errors I have explicitly suppressed with @. I’ve been using fsockopen and that throws a warning when it can’t connect. I accept the no-connection, but don’t want to see the error. Not even on dev.

Apparantly all errors go though the custom error handler, even if they were suppressed in the code.

My error handler has only 4 arguments: errno, error, file, line. From those I can’t see whether the error was originally suppressed or not. If I can see that there, I can choose whether to print the error (right now I always do, if env=dev).

Any ideas? Or maybe on how to completely ignore suppressed errors (so that they don’t even reach the custom error handler)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:54:56+00:00Added an answer on May 25, 2026 at 4:54 pm

    There’s a hint to this in the set_error_handler manual page.

    [the error_reporting()] value will be 0 if the statement that caused the error was
    prepended by the @ error-control operator

    When you use the error control operator @, what is happening is this:

    1. error reporting is set to 0 (no errors) – error_reporting(0)
    2. the expression is evaluated
    3. error reporting is set back to the previous value (ie turned back on)

    The slightly confusing quote above refers to the fact that error_reporting returns the current setting. If you have suppressed the error with the control operator, calling error_reporting() will return 0.

    Therefore, if you know you have set it to non-zero (ie you are reporting some errors) and it returns zero, you know the error was suppressed.

    If you detect a suppressed error and want to know what it was, you can find it in the variable $php_errormsg (if track_errors is set to true in php.ini).

    Note that the error control operator causes a lot of overhead, as it changes the error reporting level twice each time it is used. It will slow down your script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Fairly simple question that I can't remember. We have three environments: Local machine (unique
Context: I have a WPF App that uses certain unmanaged DLLs in the D:\WordAutomation\MyApp_Source\Executables\MyApp
Context We have a SharePoint site set up on a Windows Server 2008 VM
I have three tables like that: Articles IdArticle Title Content Tags IdTag TagName ContentTag
i have this three tables. Table: Item Columns: ItemID, Title, Content, NoChange (Date) Table:
Maybe i have the wrong context but... Is there a corelib site for mysql
my site has three div elements, header, content and footer. i have a picture
Is there some way to change Rails environments mid-way through a test? Or, alternately,
I have an app with a manifest that requires running as administrator, but part
Let's say I have a rails app with content that's read-only to the public,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.