How do i turn an array of strings into objects?
<p>I have a class Team{}.
I have an array of strings $teams = array('team1', 'team2', 'team3').
I want to loop through the array and create an object with each string as the object name.</p>

<pre><code>class Team{}

$teams = array('team1', 'team2', 'team3');

foreach ($teams as $team) {
    $team = new Team();
}
</code></pre>

<p>So $team1, $team2 and $team3 becomes object.</p>

<p>Thanks for your help.</p>