Assist your to debug vars. Accept n vars parameters
Included Debug on ARRAY an IteratorInterface Object

@param mixed $arg1
@param mixed $arg2
@param mixed $arg3
349299
public static function PrintValue($arg1, $arg2 = null)
	{
		if (self::$_logger == null)
			self::$_logger = new LogWrapper('debug.output');

		for ($i = 0, $numArgs = func_num_args(); $i < $numArgs ; $i++)
		{
			$var = func_get_arg($i);
			ErrorHandler::getInstance()->addExtraInfo('DEBUG_' . (Debug::$count++), $var);

			if (array_key_exists("raw", $_REQUEST))
			{
				continue;
			}

			if (is_array($var))
			{
				self::writeLog(null, print_r($var, true), true);
			}
			elseif ($var instanceof SingleRow)
			{
				self::writeLog('SingleRow', print_r($var->toArray(), true), true);
			}
			elseif ($var instanceof AnyDataset)
			{
				Debug::PrintValue($var->getIterator());
			}
			elseif ( ($var instanceof IteratorInterface) || ($var instanceof AnyIterator) )
			{
				$it = $var;
				if (!$it->hasNext())
				{
					self::writeLog('IteratorInterface', "Não trouxe registros.", false);
				}
				else
				{
					$result = "<style>.devdebug {border: 1px solid silver; padding: 2px;} table.devdebug {border-collapse:collapse;} th.devdebug {background-color: silver}</style>"
							. "<table class='devdebug'>";
					$arr = null;
					while ($it->hasNext())
					{
						$i++;
						$sr = $it->moveNext();
						if ($i>100)
							break;

						if (is_null($arr))
						{
							$arr = $sr->getFieldNames();
							$result .= '<tr><th class="devdebug">' . implode('</b></th><th class="devdebug">', $arr) . '</th></tr>';
						}

						$raw = $sr->toArray();
						$result .= '<tr>';
						foreach($raw as $item)
						{
							$result .= '<td class="devdebug">';
							if (is_array($item))
							{
								$result .= implode(',', $item);
							}
							else
							{
								$result .= $item;
							}
							$result .= '</td>';
						}
						$result .= '</tr>';
					}
					$result .= "</table>";
					self::writeLog('IteratorInterface', $result, false);
				}
			}
			elseif ($var instanceof IteratorFilter)
			{
				$filter = $var->getSql("ANYTABLE", $param, "*");
				$filter = substr($filter, strpos($filter, "where") + 6);
				$result = array(
					"XPath" => $var->getXPath(),
					"Filter" => $filter
				) + $param;

				self::writeLog(get_class($var), print_r($result, true), true);
			}
			elseif ($var instanceof FilenameProcessor)
			{
				$result = array(
					"PathSuggested()" => $var->PathSuggested(),
					"PrivatePath()" => $var->PrivatePath(),
					"SharedPath()" => $var->SharedPath(),
					"Name" => $var->ToString(),
					"Extension()" => $var->Extension(),
					"FullQualifiedName()" => $var->FullQualifiedName(),
					"FullQualifiedNameAndPath()" => $var->FullQualifiedNameAndPath(),
					"getFilenameLocation()" =>  $var->getFilenameLocation(),
					"File Exists?" => file_exists($var->FullQualifiedNameAndPath()) ? "yes" : "no"
				);

				self::writeLog(get_class($var), print_r($result, true), true);
			}
			elseif ($var instanceof LanguageCollection)
			{
				self::writeLog("", get_class($var) . ": Is Loaded? " . ($var->loadedFromFile() ? 'yes' : 'no'), false);
				$var->Debug();
			}
			elseif (is_object($var))
			{
				if ($var instanceof DOMDocument)
				{
					$var->formatOutput = true;
					self::writeLog(get_class($var), htmlentities($var->saveXML()), true);
				}
				elseif ( ($var instanceof DOMElement) || ($var instanceof DOMNode) )
				{
					$doc = $var->ownerDocument;
					$doc->formatOutput = true;
					echo htmlentities($doc->saveXML($var)) . "</pre>";
					self::writeLog(get_class($var), htmlentities('[' . $var->nodeName . "]") . "\n" . htmlentities($doc->saveXML()), true);
				}
				else
				{
					self::writeLog(get_class($var), print_r($var, true), true);
				}
			}
			elseif (gettype($var) == "boolean")
			{
				self::writeLog("", '(boolean) ' . ($var ? "true":"false"), true);
			}
			else
			{
				self::writeLog("", gettype($var) . ": ". $var, true);
			}
		}
	}
768202
protected function applyArguments($argDef, $argValues)
    {
        $storeEnv = $this->getStoreEnv();

        $env = new Environment;
        $env->store = $storeEnv->store;

        $hasVariable = false;
        $args = [];

        foreach ($argDef as $i => $arg) {
            list($name, $default, $isVariable) = $argDef[$i];

            $args[$name] = [$i, $name, $default, $isVariable];
            $hasVariable |= $isVariable;
        }

        $keywordArgs = [];
        $deferredKeywordArgs = [];
        $remaining = [];

        // assign the keyword args
        foreach ((array) $argValues as $arg) {
            if (! empty($arg[0])) {
                if (! isset($args[$arg[0][1]])) {
                    if ($hasVariable) {
                        $deferredKeywordArgs[$arg[0][1]] = $arg[1];
                    } else {
                        $this->throwError("Mixin or function doesn't have an argument named $%s.", $arg[0][1]);
                        break;
                    }
                } elseif ($args[$arg[0][1]][0] < count($remaining)) {
                    $this->throwError("The argument $%s was passed both by position and by name.", $arg[0][1]);
                    break;
                } else {
                    $keywordArgs[$arg[0][1]] = $arg[1];
                }
            } elseif (count($keywordArgs)) {
                $this->throwError('Positional arguments must come before keyword arguments.');
                break;
            } elseif ($arg[2] === true) {
                $val = $this->reduce($arg[1], true);

                if ($val[0] === Type::T_LIST) {
                    foreach ($val[2] as $name => $item) {
                        if (! is_numeric($name)) {
                            $keywordArgs[$name] = $item;
                        } else {
                            $remaining[] = $item;
                        }
                    }
                } elseif ($val[0] === Type::T_MAP) {
                    foreach ($val[1] as $i => $name) {
                        $name = $this->compileStringContent($this->coerceString($name));
                        $item = $val[2][$i];

                        if (! is_numeric($name)) {
                            $keywordArgs[$name] = $item;
                        } else {
                            $remaining[] = $item;
                        }
                    }
                } else {
                    $remaining[] = $val;
                }
            } else {
                $remaining[] = $arg[1];
            }
        }

        foreach ($args as $arg) {
            list($i, $name, $default, $isVariable) = $arg;

            if ($isVariable) {
                $val = [Type::T_LIST, ',', [], $isVariable];

                for ($count = count($remaining); $i < $count; $i++) {
                    $val[2][] = $remaining[$i];
                }

                foreach ($deferredKeywordArgs as $itemName => $item) {
                    $val[2][$itemName] = $item;
                }
            } elseif (isset($remaining[$i])) {
                $val = $remaining[$i];
            } elseif (isset($keywordArgs[$name])) {
                $val = $keywordArgs[$name];
            } elseif (! empty($default)) {
                continue;
            } else {
                $this->throwError("Missing argument $name");
                break;
            }

            $this->set($name, $this->reduce($val, true), true, $env);
        }

        $storeEnv->store = $env->store;

        foreach ($args as $arg) {
            list($i, $name, $default, $isVariable) = $arg;

            if ($isVariable || isset($remaining[$i]) || isset($keywordArgs[$name]) || empty($default)) {
                continue;
            }

            $this->set($name, $this->reduce($default, true), true);
        }
    }
330042
public function merge($debugger) {
		if (!is_array($this->data)) {
			throw new RuntimeException('Data is not an array');
		} else if (!is_array($debugger)) {
			throw new InvalidArgumentException('Argument is not an array');
		} else {
			$this->data = array_merge_recursive($this->data, $debugger);
		}
	}
852728
function varargs(args) {

  var argl = args.length;
  var arga;

  if (!Array.isArray(args)) {
    arga = new Array(argl);
    for (var i = 0; i < argl; i++) {
      arga[i] = args[i];
    }
  }

  return arga;
}
470161
private function fixArgs(array $args, array $parsedVars = []): array
    {
        array_shift($args); // script name
        $vars     = [];
        $position = 0;
        foreach ($args as $arg) {
            if (isset($parsedVars[substr($arg, 1)]) || isset($parsedVars[substr($arg, 2)]) || in_array($arg, $parsedVars)) {
                continue;
            }

            $vars['argv.' . $position] = $arg;
            $position++;
        }

        return array_merge($vars, $parsedVars);
    }
726537
private function on_mailer_init( array $args ) {

		$mailer = $args ? reset( $args ) : NULL;
		if ( $mailer instanceof \PHPMailer ) {
			$mailer->SMTPDebug   = 2;
			$mailer->Debugoutput = function ( $message ) {

				// Log the mailer debug message.
				do_action( \Inpsyde\Wonolog\LOG, new Debug( $message, Channels::HTTP ) );
			};
		}

		return new NullLog();
	}
765195
protected function setVar($arg1, $arg2 = null)
    {
        // One argument has to be an assoc array
        if (!isset($arg2) && is_array($arg1)) {
            foreach ($arg1 as $var => $value) {
                $this->vars[$var] = $this->varHandleObject($value);
            }
        }
        elseif (isset($arg2)) {
            $this->vars[$arg1] = $this->varHandleObject($arg2);
        }
        else {
            Throw new ControllerException('The vars to set are not correct.', 1001);
        }

        return $this;
    }
149658
function (args1, args2) {
	var i,
		len = args1.length;
	if (len === args2.length) {
		for (i = 0; i < len; i += 1) {
			var arg1 = args1[i],
				arg2 = args2[i];
			if (arg1 !== arg2) {
				return false;
			}
		}
		return true;
	} else {
		return false;
	}
}
1010427
public static function debug($message, $args = array())
    {
        if (Logger::$output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
            /** @noinspection HtmlUnknownTag */
            Logger::$output->writeln('<fg=green>' . vsprintf($message, $args));
        }
    }
864418
public function evaluateArgs(array $args) : void
    {
        array_shift($args);

        if (count($args) < 2) {
            $this->out->red("Not enough arguments: expects 2, got ".(count($args) - 1).".");
            return;
        }

        $this->setName($args[0]);
        $this->setLocation($args[1]);
        if (isset($args[2])) {
            $this->additionalArgs(array_slice($args, 2, count($args)));
        }

        return;
    }
386558
public static function compare($arg1, $arg2, $scale = null) : int {
		return bccomp($arg1 . '', $arg2 . '', $scale ?? self::$scale);
	}
143624
protected function _add( $arg1, $arg2 ) {
		if ( is_numeric( $arg1 ) && is_numeric( $arg2 ) ) {
			return $arg1 + $arg2;
		} elseif ( is_numeric( $arg2 ) ) {
			return $arg1;
		} elseif ( is_numeric( $arg2 ) ) {
			return $arg2;
		}

		return '-';
	}
858969
protected function injectVariables(array $args)
    {
        if (empty($args)) {
            return;
        }

        $parser = $this->parserFactory(__METHOD__);

        foreach ($args as $name => $strValue) {
            if ($name[0] === '$') {
                $name = substr($name, 1);
            }

            if (! $parser->parseValue($strValue, $value)) {
                $value = $this->coerceValue($strValue);
            }

            $this->set($name, $value);
        }
    }
1124580
public function vars($args)
    {
        $this->_query .= implode(',', array_fill(0, count($args), '?'));
        foreach ($args as $arg) {
            $this->_args[] = $arg;
        };
        return $this;
    }
1056152
public function debug(
        $msg,
        array $args = array(),
        \Exception $exception = null
    ) {
        return $this->log(\Plop\DEBUG, $msg, $args, $exception);
    }
990746
def iter_def_argspec(self):
        
        started_kwargs = False
        seen_vars = set()

        for var, value in self.argpairs:
            if var is None:
                # value is actually the name
                var = value
                value = None

                if started_kwargs:
                    raise SyntaxError(
                        "Required argument %r must precede optional arguments"
                        % (var.name,))

            else:
                started_kwargs = True

            if not isinstance(var, Variable):
                raise SyntaxError("Expected variable name, got %r" % (var,))

            if var.name in seen_vars:
                raise SyntaxError("Duplicate argument %r" % (var.name,))
            seen_vars.add(var.name)

            yield var.name, value
854792
protected function debug($message, $args = array()) {
    if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
        /** @noinspection HtmlUnknownTag */
        $this->output->writeln('<fg=green>'.sprintf($message, $args));
        }
    }