How can I make the switch respect data types ( is there a workaround better then if/else ) ?
Bare in mind that you're asking PHP to juggle types.
If you see the PHP type comparison table you'll see that, for example, null and '' are loosly equivalent, ie null == ''.
null
''
null == ''