I don't know the specifics and that's an excellent question to pose to Warren.
Oh Warren!!! Your services are needed!!
(Ever think he sighs exasperatedly saying "Oh what does that bat want now??" )
The specifics are very clear.
When Philip dies, like all other titles his will follow the original Letters Patent which has the title going to his male heirs.
So
1. Charles is heir to his father's title of Duke of Edinburgh and will inherit the Edinburgh title on the passing of his father.
2. Charles is also heir to his mother's title of monach so when he has inherited both of his parents' titles the Duke of Edinburgh title will have merged with that of the Crown in that the holder of both titles will be one and the same person - namely Charles.
3. That means that the Edinburgh title is available to be regranted.
4. In 1999 it was announced that the intention is that when Charles has inherited the Edinburgh title AND the crown he will recreate the Edinburgh title for his youngest brother, Edward and thus Edward will be Duke of Edinburgh, Earl of Wessex and Viscount Severn.
However:
That assumes that the expected scenario takes place in that Charles inherits both titles but....
if Charles, William, Harry and Andrew all predecease Philip then Edward would inherit all of his father's titles in his own right as Beatrice can't inherit the Edinburgh (or York) title being female, but she can inherit her grandmother's throne.
or
if William marries and has a daughter, then William dies and Charles also dies before Philip, then the throne passes to that daughter and Harry inherits the Edinburgh title and the title doesn't merge with the crown at all and Edward then doesn't become a Duke (although in that scenario he might still be given a Dukedom - say of Cambridge).
Because of the alternate scenarios we can only say that it is expected that Edward will, at some time in the future be created Duke of Edinburgh but his chances of actually inheriting the title directly are rather small.