Is there a way to create a dynamically expandable list in PHP without specifying a limit like in arrays?

When working with arrays in PHP, it is common to specify a fixed size limit when creating them. However, if you need a dynamically expandable list without a predefined limit, you can use PHP's built-in array functions to achieve this. One way to do this is by using the array_push function to add elements to the array as needed, allowing it to grow dynamically without specifying a limit.

// Create an empty array
$list = [];

// Add elements to the array dynamically
array_push($list, "element1");
array_push($list, "element2");
array_push($list, "element3");

// Print the dynamically expandable list
print_r($list);