Home  >  Article  >  Backend Development  >  Can the data in the stack be modified? For example, can numerical data be modified?

Can the data in the stack be modified? For example, can numerical data be modified?

WBOY
WBOYOriginal
2016-08-22 10:12:411251browse
<code>var str = "abc";
str[0]; // "a"
str[0] = "d";
str; //仍然是"abc"</code>

The string is immutable so it cannot be modified

Then can the data in the stack be modified?
For example, num=10;num=11;
What is changed is the value 10 in the stack is changed to 11,
or a new num=11 is created in the stack and the original memory is What about deletion?

Statement:
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