Declare the array. The error gets removed once you declare the array. In the following example we declare field as an array before declaring the array.
<?php
$field = array();
...