About PHP variable declaration and storage method in memory

藏色散人
Release: 2023-04-08 18:08:01
forward
2435 people have browsed it

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;
Copy after login

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!

Related labels:
source:shenhuangji
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template