Write a function that tells you which of its lines has been removed Write a function that contains five lines.

If you run the function as-is, it should return 0.

If you remove any one of the five lines and run the function, it should tell you which of the lines has been removed (e.g., if you remove the final line it should return 5).

Brevity, novelty, and elegance all deserve consideration.  Highest upvoted solution (after a reasonable amount of time) wins.
Ruby

Eschewing magic numbers since it's not code golf.

def f
  r=2^3^4^5
  defined?(r) ? r^=2 : r=1^3^4^5
  r^=3
  r^=4
  r^=5
end


Each line strips its own number out of 1^2^3^4^5. It's Ruby, so the last line defines the return value.