Each programming language, its variables have a certain range of valid, beyond this range, the variable is invalid, which is the scope of the variable. From the point of view of mathematics, it is the field of the independent variable.
Scopes are
Each programming language has a valid range of variables, beyond which the variable is invalidated, which is the scope of the variable. From a mathematical point of view, it is the domain of the independent variable.Scope is the accessible scope of
Each programming language has a valid range of variables, beyond which the variable is invalidated, which is the scope of the variable. From a mathematical point of view, it is the domain of the independent variable.Scope is the accessible scope of
Excerpt from: http://www.qianyunlai.com.com/blog/220.html
Each variable in PHP has a scope for it, which is an area in which you can access a variable (and thus access its value). For starters, variables are scoped to the page where they reside.
In object-oriented programming, some of its own operators, such as->, are used to access its own members in an object. The other one is the scope resolution operator: Two colons joined together (::). This symbol is used to access members in the
This article mainly introduces the scope of PHP, has a certain reference value, now share to everyone, the need for friends can refer to
The area to which the variable can be accessed.JS in scope:Global scope: can be used anywhere (outside the
"Base" PHP variable and variable scope, PHP variable scope
The newly-learned PHP, more interesting syntax, recorded.
1. Scope of variables
The scope is only two global and local,global relative to the entire. php file, Local is the minimum range,
Variable scope is a variable between the page and function can use each other, its scope of action, the following small series to introduce you to the PHP variable using the domain of some learning notes to get out and exchange with you.
The scope
The scope of the variables in PHP is described in the PHP manual
In a user-defined function, a local function range is introduced. Any variable that is used inside a function is limited by default to the scope of the local function. For example:
Php variable scope learning notes sharing. Variable scope is the scope of a variable that can be used between pages and functions, the following small series will introduce some learning notes about the use of php variables in the domain. the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.