diff --git a/lib/Toby/Base.php b/lib/Toby/Base.php index 2326f53..09ee033 100644 --- a/lib/Toby/Base.php +++ b/lib/Toby/Base.php @@ -69,9 +69,10 @@ public function content_type($type = null, $params = array()) public function error() { - $codes = (func_num_args() > 1)? array_shift(func_get_args()) : array("all"); + $args = func_get_args(); + $codes = (count($args) > 1)? array_shift($args) : array("all"); if(!is_array($codes)) $codes = array($codes); - $block = array_pop(func_get_args()); + $block = array_pop($args); foreach($codes as $code) $this->errors[$code] = $block; }