Can't comment on PHP2 (never seen it!) but there are enough differences with php3 vs. php4 that you can't expect all functions to work the same.
Some even work rather differently - cookies for example. In PHP3, you had to do cookie-stuff backwards!
Of course, material that deals with cookies under PHP3 will be broken when upgrading to 4.0.
That said, when push comes to shove, php4.0 offers so much functionality beyond 3.x, and I'd imagine that the same is true from 3.x to 2.x, I'd highly recommend upgrading immediately if you are at all serious about doing meaningful work.
-Ben