Anvils have damage on any mobs, but if the mob standing on a half block (any kind of slabs) they get damage, but the anvil breaks
I were playing in creative, trying to figure out some glitches.
I placed a half slab (stone slab) and spawned a creeper, and other kind of mobs on it. ( I made it in a hole) and from the top of the hole, I placed an anvil, which is falled down, and KILLED the mob, but it is turned into an item after falling down. After picking up the item, I've noticed that the Anvil is did not get ANY kind of damage. ( It just stayed in anvil, and did not turned into a slightly or a very damaged anvil.) Since I dropped the anvol from 40 blocks.