-2

Is foo[] an array?

In the following code is an array element being assigned to foo[]? And is there an array key that is automatically associated with it?

$this->foo[] = 'hello world';
Dan
  • 9,391
  • 5
  • 41
  • 73
Simon Suh
  • 10,599
  • 25
  • 86
  • 110

1 Answers1

1

This is adding an element to the end of the foo array.

It's the same as using array_push().

Drown
  • 5,852
  • 1
  • 30
  • 49