There was a need to create a class object in the cycle. The cycle can be 1000 or more iterations. I'm having doubts about the use of memory. Therefore, the question of whether to do so?. Ready to hear the pros and cons of using this design. In advance thank everyone for answers.
Code example:
foreach($entities as $entity) {
$object = new $class($entity);
$object->doSomething();
}