What kind of array does PHP use?

I can define an array in PHP like this:

$array = array();

In C++, we have two kinds of array.

  1. The first kind is a fixed size array, for example:
    int arr[4]; // 4 ints, hardcoded size
    
  2. The second kind is a dynamic sized array
    std::vector<int> v; // can grow and shrink at runtime
    

What kind of array does PHP use? Are both kinds of arrays in PHP? If so, can you give me examples?

Posted by Surya Infotech

Leave a Reply