Why should the done property be used in a loop rather than a condition in PHP threads?

Using the `done` property in a loop is preferred over using it in a condition in PHP threads because it ensures that the loop continues until the thread has completed its execution. This prevents the loop from prematurely exiting before the thread has finished processing. By checking the `done` property within the loop, you can safely wait for the thread to complete before moving on to the next iteration.

$thread = new Thread(function(){
    // Thread logic here
});

$thread->start();

while($thread->isRunning()){
    // Loop logic here
}

$thread->join();