Hello, where can I read about memory in PHP. I am not familiar with C, but I am interested in the following:

$pizza = "кусок1 кусок2 кусок3 кусок4 кусок5 кусок6"; explode(" ", $pizza); 

I wonder how the memory is allocated, where the array is stored, which is returned by explode() (without a variable), can it be accessed without a variable. I want to know more details.

  • Stored in memory. Where else is stored. But if you do not assign the result of the function, the result will be lost (and in some cases, the compiler / interpreter may even throw out a similar string). - KoVadim
  • I believe that this is a huge difference between php and c / c ++. PHP is a scripting language. Roughly speaking the script. It does not store data in processor memory, in memory cells, as C does. Roughly speaking, the teams follow it clearly and consistently. There is no value without a variable. Print it, or transfer it - using the same return or echo , for example, without problems. But to save without a variable - nev ...))) - intro94
  • one
    the result is an explode(" ", $pizza); is an array, the memory area occupied by it will immediately be labeled for garbage collection, as it works in php in detail, I do not know, read the php source code they are in C (have to get acquainted)
  • 2
    In a heap everything is lying around, as in any other weakly typed language. > is it possible to access it without a variable? I'm not sure that PHP generally has memory functions, but if it does, you will still need to overtake GC. - etki

0