0

i am new to php . i want to know the place where the array data and the address of array are being stored ? are they storing in heap and stack , respectivelylike C# ?

I read many articles but I could not found the answer . I used bard to find the answer but I am not sure that is correct . his answer is both of array data and its address are stored in heap

3
  • Any particular reason why you need to know? One of the advantages of a lot of languages like this is that you don't need to manage the memory and so concentrate on the algorithm rather than managing memory.
    – Nigel Ren
    Commented Aug 26, 2023 at 12:27
  • 1
    Everything is stored on the heap.
    – Olivier
    Commented Aug 26, 2023 at 13:00
  • npopov.com/2012/03/28/… Commented Aug 26, 2023 at 19:40

1 Answer 1

0

The actual values you store in an array are stored in blocks of memory. PHP optimizes this storage by PHP's Zend Engine, to efficiently hold various types of values (integers, strings, objects, etc.). and also uses a hash table (hash map) internally to manage the association types. but the detail of how the PHP Engine works with the values and addresses is related to its kernel, and not to the place they are stored.

Not the answer you're looking for? Browse other questions tagged or ask your own question.