こうやると
http://ideone.com/pOHdD
こんな結果になった
ttp://tsushima.2ch.at/s/news2ch56535.png
objectにして渡して中で型判断するってのはどうなんだろ?