While executing PHP scripts, in which segment of Memory, variables are stored?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vvtt
    New Member
    • May 2011
    • 2

    While executing PHP scripts, in which segment of Memory, variables are stored?

    Iam new to PHP, I have experience in C/C++. I have the following doubt:

    In C or C++ 1) function variables are stored on stack. 2) Global and Static variables are stored on data segment(.bss segment). 3) Register variables are stored in Register 4) program instructions get stored in code segment 5) The memory created dynamically are stored in Heap.

    What i want to know is, does above mentioned points are true also for "PHP". That is, Is memory segments & Memory allocation while executing a "PHP" script is similar to that of C/C++?
    Last edited by vvtt; May 16 '11, 09:02 PM. Reason: Sentence rearranged
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    let’s put it that way, the PHP interpreter is written in C.

    Comment

    • vvtt
      New Member
      • May 2011
      • 2

      #3
      @Dormilich

      Thanks a lot for you reply.

      Any way almost for every language the Interpreters are written in C/C++.

      1) what about PHP Core Packages & Core Classes are they written in C?

      2) While executing PHP scripts the executable image created and PROCESS MEMORY LAYOUT are they similar to C program execution?

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        1) obviously
        2) dunno

        Comment

        Working...