Geochemical estimates indicate that around 90% of the planet's inventory of phosphorus is likely to be sequestered in the Earth's core. Iron phosphides such as scheirbisites (Fe3P) are commonly found in iron meteorites. Recently, melliniite (Fe,Ni)4P with 12.2 wt% phosphorus has been reported in iron-meteorites. Using static electronic structure calculations, we predict that Fe4P is unlikely to dissociate into Fe3P and hcp Fe at inner core conditions. Among the different structural varieties of Fe4P, we find the cubic polymorph with P213 space group symmetry to be stable over a wide range of geophysically relevant pressures. We have determined the equation of state and the full elastic constant tensor of the stable (Fe,Ni)4P phase at pressures up to 400 GPa. Upon compression, Fe4P undergoes a ferromagnetic (fm) to nonmagnetic (nm) transition at 80 GPa. In nonmagnetic (Fe,Ni)4P, nickel incorporation results in reduction of the P- and S-wave velocities. However, incorporation of nickel enhances the P- and S-wave anisotropy.