Can I unlock an iphone and still develop apps for it? I am being offered an iphone 4 but it is locked to orange and I want to use my O2 sim in it. 

The thing is that I want the phone so I can go into app development and have heard that working with a jailbroken phone can be a problem. 

I have read here that jailbreaking and unlocking are different things but unlocking needs jailbreaking however jailbreaking can be reversed but there's no info on weather that will undo the unlocking so I am really confused :S

So can I unlock an iphone and still develop apps with no problems assuming I have a developers licence and update regularly?
According to this KB, Orange UK offers authorized unlock, so if the person that is giving you the phone is out of contract, he/she could be able to ask Orange to unlock it. This way you don't have to worry about the whole jailbreaking/unlocking business, if you only care about unlocking. Authorized unlock is like having never locked (factory unlocked) phone and doesn't affect/change the firmware, which is the issue that you are worrying about.