Consider following code:
$ob=new MyObject();
$ob->name=$_GET['name'];
$ob->email=$_GET['email'];
...
$ob->foo=$_GET['foo'];
Is there any cleaner way (language mechanism) to populating an object's property with an associative array. (without using foreach
or similar constructs)?