PHP global or $GLOBALS

Viewed 46558

Is there a best practice / recommendation when I want to use a variable declared outside of a function when it comes to using:

  1. global $myVar
  2. $GLOBALS['myVar']

Thank you.

4 Answers
Related