My friend is a Canadian citizen and currently in the UK on a Tier 5 Youth Mobility visa. This expires at the end of July. She has obtained a place at a UK university and that course starts in mid-September. Her Tier 4 Student Visa would therefore start a month before then, in mid-August. It is clear that she must be out of the country between her two visas.
Her plan is to go back to Canada in about mid-July in order to sort out her student visa (you cannot apply for the student visa in the UK while on a Youth Mobility visa). In early August she would fly to somewhere on mainland Europe before returning to the UK for when her student visa starts.
The only issue is that she will need to get a connecting flight in the UK on her way back from Canada to Europe. Will it be an issue with UK Immigration that she is in between visas when she tries to connect flights in a British airport?
This paragraph from Heathrow's website seems to say that she will have to go through immigration but that it should be fine if she has an outbound booking and sufficient documentation.
Please note that it is a Border Force requirement that all passengers entering the UK must present themselves to Immigration at the first port of call. Therefore it is important that your passport/visa allows you entry into the UK. You can apply for a 24-hour visa on arrival. This is at the discretion of the Immigration Officer, who must be satisfied that you have a confirmed booking of onward travel within 24 hours.