Well I read the manuals on php.net, it says that ArrayObject can make objects work in array way, which enables easy iteration, counting and sorting. According to this definition the ArrayObject class should accept an object as its parameter. But the question is, does it work in the other way, in which an array can behave like an object with its elements as public properties? Lets say I have a user input $_POST array which contains username and email entered by user, will the following code below work flawlessly?
$input = array_map('parseinput', $_POST);
$input = new ArrayObject($input);
echo $input->username;
echo $input->email;