I don't have a compiler at hand here, but auto-boxing introduced in Java 5 is usually the culprit behind "surprising" Java behaviour. I sometimes have Eclipse configured to mark up implicit conversion between primitive and boxed object (but to be honest it's usually not worth it; I've never encountered any such surprises anywhere other than intentional puzzles like yours).
One possible answer, then, would be that T1 and T3 are Integer, while T2 is int; v1 and v3 are both new Integer(1000), and v2 is 1000. The a == b and b == c expressions will un-box a and c respectively, but a == c will compare object references (and find them different since both were constructed with new).
Another fun quirk only ever encountered in puzzles like this: if you change v1 and v3 to, say, 7, (ie, a primitive value that will be boxed in order to be assigned to a and c), you'll get "false" instead, because a != c will be false, since Integer.valueOf(int) (which is the method called to convert the primitive values to Integer objects to be assigned to a and c) happens to maintain a pool of Integer objects for small values, and will return the same value for both a and c.
Getting back to the topic at hand, the difference to note here is that these are carefully-crafted puzzles in Java; the problem with PHP is that quirks like this are something you more or less always have to think about when you're writing PHP.