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 6617905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:45:36+00:00 2026-05-25T20:45:36+00:00

Like most of our code base, our mysql handling functions are custom built. They

  • 0

Like most of our code base, our mysql handling functions are custom built.

They work very well and include a number of logging forks.

A simplified version of our query execution function looks like this:

if(!$result=mysql_query($query)){
    file_put_contents(QUERYLOG,'Query '.$query.' failed execution');
}

This is overly simplified, but you get the basic idea: If queries fail, they will be logged to a separate query log.

This is a great way of keeping track of any queries that need to be looked at.

My question is as follows:

With the above, the tiny problem is that if a query fails both our query log, AND our php log will be stamped with the error as a mysql_query (… or mysql_connect, mysql_select_db, etc …) will produce a php error.

What we want to do is surpress the php error via:

.... $result=@mysql_query($query ....

So, as far as the question goes:

Does using the @ error suppression mechanism in php cause any performance impacts if no error is produced? Or does it only affect performance if an error is produced?

I know I know, micro optimization, but as you can guess, or query execution function is used millions of times a day, so even a small performance hit is worth examining.

  • 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-25T20:45:37+00:00Added an answer on May 25, 2026 at 8:45 pm

    made a little “research”

    $s = microtime(true);
    $a = array('1','2');
    $b = $a[1];
    echo microtime(true)-$s;
    

    gives 1.1205673217773E-5
    and if i use $b = @$a[1]; i get a bit more: 1.5974044799805E-5

    so: yes, there is a difference, but no, you should not bother.

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

Sidebar

Related Questions

The Setup Most of our code base is in VB.NET. I'm developing a project
In our system most of the code is in an asp.net (2.0) web site,
I work on a large code base with a large install base of users.
We are looking at adding unit tests to our C# code base. I am
Like most *nix people, I tend to play with my tools and get them
Like most developers, I'm a business developer, which in essence consists of slapping a
Like most developers here and in the entire world, I have been developing software
Like most people, I learnt C++ after C. I learnt C++ because it was
Like most web developers these days, I'm thoroughly enjoying the benefits of solid MVC
So like most new .NET developers you start of passing DataSets everywhere and although

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.