A plate heat exchanger comprising a plate package of heat exchanger plates being stacked onto each other to form first plate interspaces for a primary medium, second plate interspaces for a first secondary medium, and third plate interspaces for a second secondary medium, wherein each of the heat exchanger plates (A, A', A", B, B', B") extends in parallel with an extension plane (p) and comprises a heat exchanger area with a corrugation that extends between a top plane and a bottom plane, which are parallel to each other and to the extension plane (p), wherein the plate package comprises six ports (11, 12, 21, 22, 31, 32) extending through the heat exchanger plates (A, A', A", B, B', B") and comprising a first inlet port and a first outlet port for the supply and discharge of the primary medium to and from the first plate interspaces, a second inlet port and a second outlet port for the supply and discharge of the first secondary medium to and from the second plate interspaces, and a third inlet port and a third outlet port for the supply and discharge of the second secondary medium to and from the third plate interspaces, wherein each of the ports (11, 12, 21, 22, 31, 32) is formed by a porthole through each of the heat exchanger plates (A, A', A", B, B', B"), wherein each porthole is surrounded by an outer flat area, which forms a porthole edge, wherein the outer flat area of the second inlet and outlet ports (21, 22) and the third inlet and outlet ports (31, 32) is surrounded by an inner flat area, and wherein the outer flat area of the portholes of the ports (11, 12, 21, 22, 31, 32) of the heat exchanger plates (A, A', A", B, B', B") is located at one of the top plane and the bottom plane, characterized in that the inner flat areas of the portholes of the second inlet and outlet ports (21, 22) of the heat exchanger plates (B, A), that enclose the second plate interspaces, are located at a distance from each other and from the top and bottom planes (6,7), and that the inner flat areas of the portholes of the second inlet and outlet ports (21, 22) of the heat exchanger plates (B', A'), that enclose the third plate interspaces, adjoin each other and are located at one of the top plane and the bottom plane. second plate interspaces for a first secondary medium, and third plate interspaces for a second secondary medium, wherein each of the heat exchanger plates (A, A', A", B, B', B") extends in parallel with an extension plane (p) and comprises a heat exchanger area with a corrugation that extends between a top plane and a bottom plane, which are parallel to each other and to the extension plane (p), wherein the plate package comprises six ports (11, 12, 21, 22, 31, 32) extending through the heat exchanger plates (A, A', A", B, B', B") and comprising a first inlet port and a first outlet port for the supply and discharge of the primary medium to and from the first plate interspaces, a second inlet port and a second outlet port for the supply and discharge of the first secondary medium to and from the second plate interspaces, and a third inlet port and a third outlet port for the supply and discharge of the second secondary medium to and from the third plate interspaces, a first inlet port and a first outlet port for the supply and discharge of the primary medium to and from the first plate interspaces, a second inlet port and a second outlet port for the supply and discharge of the first secondary medium to and from the second plate interspaces, and a third inlet port and a third outlet port for the supply and discharge of the second secondary medium to and from the third plate interspaces, wherein each of the ports (11, 12, 21, 22, 31, 32) is formed by a porthole through each of the heat exchanger plates (A, A', A", B, B', B"), wherein each porthole is surrounded by an outer flat area, which forms a porthole edge, wherein the outer flat area of the second inlet and outlet ports (21, 22) and the third inlet and outlet ports (31, 32) is surrounded by an inner flat area, and wherein the outer flat area of the portholes of the ports (11, 12, 21, 22, 31, 32) of the heat exchanger plates (A, A', A", B, B', B") is located at one of the top plane and the bottom plane, characterized in that the inner flat areas of the portholes of the second inlet and outlet ports (21, 22) of the heat exchanger plates (B, A), that enclose the second plate interspaces, are located at a distance from each other and from the top and bottom planes (6,7), and that the inner flat areas of the portholes of the second inlet and outlet ports (21, 22) of the heat exchanger plates (B', A'), that enclose the third plate interspaces, adjoin each other and are located at one of the top plane and the bottom plane.