Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    Downvotes because you told someone to use error suppression. Commented May 14, 2018 at 21:56
  • 1
    I give an alternative answer, as you can see in my begining of answer I still suggest to use error_reporting Commented May 16, 2018 at 2:30
  • 2
    It doesn't deserve downvotes because I just learned something new from this :) Commented Apr 21, 2020 at 12:29
  • @RJFares Thanks. :-) Commented Apr 21, 2020 at 17:53
  • On the other hand, I know there may be some null or undefined value, and I am going to handle it below, but I do not want to supress other warning that I have not handled. It looks so clumsy to make checking with ` if (!isset(...) || !isset(...))` but if (!$var0 || !$var1) looks much clearer Commented Mar 13, 2024 at 18:22