Home > Article > Backend Development > PHP underlying analysis about forced splitting
Learning requires knowing what it is and why it is. The underlying knowledge of PHP is this kind of knowledge.
Recommended: "PHP Training"
Today we will talk about the knowledge about forced splitting. Simply put, forced splitting is "before the reference variable is actively assigned a value, the If a variable is assigned a value, forced splitting will occur."
It's a bit convoluted, let's take a look at the code analysis.
Look at the following code:
If you are slightly familiar with PHP: & reference symbols, you should be able to see that the output is gzchen, 8:30 in the evening, gzchen .
So let’s take a look at the underlying running process of the above code.
As we all know, a variable is a structure, which looks like this:
Comments are written on each line. This file is in zend.h in PHP Source code Zend directory.
When the code runs to line: 3[$name = '8:30 in the evening'], the structure in the memory looks like this:
When the code runs to line: 4[name], the structure becomes like this:
##Run to line: 5[Misplaced &<span style="max-width:90%"></span>
name] and line: [$nameCopy = 'gzchen'], like this:
Copy while writing (cow) during interviews.
For more programming related content, please pay attention to theProgramming Introduction column on the php Chinese website!
The above is the detailed content of PHP underlying analysis about forced splitting. For more information, please follow other related articles on the PHP Chinese website!