Reference incompatible class object

http://ideone.com/vmiHzM