My name is Mercedes from WPML. We have received a request in our forum to check on the compatibility with PHP Code for posts. You can see it here http://wpml.org/forums/topic/language-detect/
We would like to do it and are ready to offer good help.
Could you please drop me a line back?