SRD:Sword of the Planes

Sword of the Planes: This longsword has an enhancement bonus of +1 on the Material Plane, but on any Elemental Plane its enhancement bonus increases to +2. (The +2 enhancement bonus also applies on the Material Plane when the weapon is used against elementals.) It operates as a +3 longsword on the Astral Plane or the Ethereal Plane or when used against opponents native to either of those planes. On any other plane, or against any outsider, it functions as a +4 longsword.

Strong evocation; CL 15th; Craft Magical Arms and Armor, plane shift; Price 22,315 gp; Cost 11,157 gp and 5 sp + 893 XP.