Use foreach() instead of deprecated each()
-while (list($key, $callback) = each($callbacks)) {
+foreach ($callbacks as $key => $callback) {
     // ...
 }Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\Php72\Rector\While_\WhileEachToForeachRector;
return RectorConfig::configure()
    ->withRules([
        WhileEachToForeachRector::class,
    ]);