Implementing ArrayAccess Interface in PHP , We can access Object Properties as Array Keys . What are the benefits of having an Object behave like an Array?
Like I see Frameworks implementing 'FORM' with ArrayAccess
Interface and then we can access (HTML) Form Objects Fields something like,
$form['nameField'] instead-of $form->nameField
$form['titleField'] instead-of $form->titleField
Whats the benefit of using $form['nameField]
instead-of $form->nameField
Is it Speed of 'Array Data Structures' or portability between Object and Array Forms ?
Or Am I missing something? :)