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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:09:31+00:00 2026-05-28T07:09:31+00:00

I am working with a previous developers code and a lot of his code

  • 0

I am working with a previous developers code and a lot of his code hide errors with the @

One example being:

if(!file_exists($filename)) 
    throw new Exception("file '$filename' does not exist.");

$xmlObject = @simplexml_load_file($filename);       
if($xmlObject === false) 
    throw new Exception("Could not load '$filename' check syntax and file has read permission.");

I understand that using the @ hides errors but is this good practice or bad?

  • 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-28T07:09:32+00:00Added an answer on May 28, 2026 at 7:09 am

    It’s bad. You should always check to make sure everything is legit. Developing good clean code will allow you to identify issues when something does go wrong. By using the @ it will suppress those errors which could be caused by something else entirely. You would never know and troubleshooting becomes that more difficult.

    Taking your example above.

    $xmlObject = @simplexml_load_file($filename);
    

    That person is already checking if the file exists. You could probably remove that @ symbol and change it up with try catch blocks.

    Try {
      $xmlObject = simplexml_load_file($filename);
    catch....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have started working on some code left behind by previous developers, and I'm
I'm working on a project where one of the co-developers (and previous developers) use
I am working through some code done by a previous developer. I'm pretty new
I'm trying to get some code working that a previous developer has written. Yep,
I've inherited another developer's code for a project I'm working on. Here's an example
Currently I'm working on the project that is just born. Previous developers used to
It seems the previous developers of the current project I'm working with decided to
I've got an SDK I'm working on and the previous developer just dropped the
I'm working through previous years ACM Programming Competition problems trying to get better at
I'm working through a previous webforms application to convert it to MVC and have

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.