Home >Backend Development >PHP Tutorial >About PHP variable declaration and storage method in memory

About PHP variable declaration and storage method in memory

藏色散人
藏色散人forward
2020-05-31 13:52:152469browse

php variable declaration and storage method in memory

①Introduction to php variables

Description: The space that can store the changing amount (data), the changing amount is determined by the context . So it is called a weakly typed language.

 ②Memory area

Stack area Heap area Function area...

PHP automatically releases variables in memory

About PHP variable declaration and storage method in memory

 ③Declaration of variables

 Note: PHP variables are defined and declared by $. Variables need to be defined and declared in memory.

Syntax: $variable name = quantity

Note: The variable name is composed of numbers (0-9), letters (a-Z), and underscores, and cannot start with a number. A good variable name should make it clear what the name means.

Eg:

//变量的申明
  $name = ‘张三’;
  $age = 18;
  $sex = true;

The above is the detailed content of About PHP variable declaration and storage method in memory. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:shenhuangji. If there is any infringement, please contact admin@php.cn delete