-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,257
  • 5
  • 40
  • 72
Simon Suh
  • 9,835
  • 23
  • 83
  • 103

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,644
  • 1
  • 30
  • 46