We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

The variable "wasFresh" in Prehalcon\Dispatcher whether the is a bug ???

public function dispatch(){
    .
    .
    .
    wasFresh = false, e;
    .
    .
    .
    while !this->_finished {
        .
        .
        .
        if dependencyInjector->wasFreshInstance() === true {
            let wasFresh = true;
        }
        .
        .
        .
        if wasFresh === true {
            if method_exists(handler, "initialize") {
                handler->initialize();
            }
        }
        .
        .
        .
    }
}

IndexController's initialize method run twice, if i use forward method goto IndexController::testAction method in IndexController::indexAction method

Doesn't looks like a bug, just forward happens in same dispatch loop. And this condition is just true and initialize method is executed again. Create issue on github if you can.