1

When the isset() is executed the following check $_SESSION['mat'] == "1" is executed or the second verification is directly skipped since it is the first false?

Is there is where I have the doubt?

if(isset($_SESSION['mat']) and $_SESSION['mat']=="1"){}
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
rai
  • 13
  • 5

2 Answers2

2

If the first part of your if statement already returns false the second part will not be evaluated. Your if statement looks good this way and shouldn't throw any index out of bounds errors.

Dirk Scholten
  • 1,013
  • 10
  • 19
0

When the isset is executed the following check is executed ($ _ SESSION ['mat'] == "1") or the second verification is directly skipped since it is the first false.

isset() will check if a variable is set otherwise it will return false. All the code inside the if() statement will be executed, so in your case, if the $_SESSION array variable isn't set, the second control, in your case and (that can be expressed also using &&) will be skipped.