diff --git a/assert.php b/assert.php index a71f57f..5903e1c 100644 --- a/assert.php +++ b/assert.php @@ -3,7 +3,7 @@ class Assert { public static function type(array $a, $class) { foreach ($a as $item) { - if (get_class($item) !== $class) { + if (get_class($item) !== $class && !is_subclass_of($item, $class)) { throw new TypeException("$item is not of type $class"); } }