-1

I am unable to understand last value 'changes' => [ ], of associate array.

$table_report = array(
        'table_name' => $table,
        'rows'       => 0,
        'change'     => 0,
        'changes'    => [ ],
    );
malik-ab
  • 39
  • 5

1 Answers1

3

[] is an alternative syntax to array() introduced in PHP 5.4

[] is just an empty array.


This

$table_report = array(
  'table_name' => $table,
  'rows'       => 0,
  'change'     => 0,
  'changes'    => array()
);

is equivalent to

$table_report = [
  'table_name' => $table,
  'rows'       => 0,
  'change'     => 0,
  'changes'    => []
];
Mulan
  • 129,518
  • 31
  • 228
  • 259