HardwareSerial Indexing Array
your code makes copies of Serials into items in the array of HardwareSerials. To use the original Serial objects, store and use pointers.

HardwareSerial* Serials[]={&amp;Serial,&amp;Serial1,&amp;Serial2,&amp;Serial3};

void setup(){
    for (int i=0;i&lt;=3;i++){
        Serials[i]-&gt;begin(38400);
        while (!*Serials[i]);
    }
}

void loop(){
    for (int i=0;i&lt;=3;i++){
        if (Serials[i]-&gt;available()){
            char s=Serials[i]-&gt;read();
            Serials[i]-&gt;write(s);
        }
    }
}