PHP uses the global keyword to make a local variable have global scope.
- TRUE
- FALSE
The statement is false. In PHP, the global keyword is used to access and modify variables with global scope from within a function. It allows you to work with global variables within the local scope of a function. By using the global keyword followed by the variable name, you can indicate that the variable being used is the global variable and not a local one. However, it does not change the scope of the variable to global. Learn more: https://www.php.net/manual/en/language.variables.scope.php#language.variables.scope.global
Loading...
Related Quiz
- Which of the following are common uses of indexed arrays in PHP?
- Constants in PHP can be defined and accessed anywhere in the script without regard to ______ rules.
- Which of the following are common uses of the json_encode() and json_decode() functions in PHP?
- You have a PHP script and you need to check if a variable is of a specified type. How would you do this?
- Which of the following are true about multidimensional arrays in PHP?