Created
June 4, 2011 22:23
-
-
Save blar/1008425 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
switch(array_filter(array(gettype($foo), is_object($foo) ? get_class($foo) : NULL))) { | |
case array('integer'): | |
var_dump('integer'); | |
break; | |
case array('object', 'foo'): | |
var_dump('foo'); | |
break; | |
case array('object', 'bar'): | |
var_dump('bar'); | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment