In PHP, you can initialize arrays with values quickly using the following notation:
$array = array(\"name\" => \"member 1\", array(\"name\" => \"member
I use a class I name Dict:
class Dict { public function __construct($values = array()) { foreach($values as $k => $v) { $this->{$k} = $v; } } }
It also has functions for merging with other objects and arrays, but that's kinda out of the scope of this question.