@param mixed $var
@param int   $maxDepth

@return mixed
344281
public static function export($var, $maxDepth)
    {
        $return = null;
        $isObj  = is_object($var);

        if ($var instanceof Collection) {
            $var = $var->toArray();
        }

        if ( ! $maxDepth) {
            return is_object($var) ? get_class($var)
                : (is_array($var) ? 'Array(' . count($var) . ')' : $var);
        }

        if (is_array($var)) {
            $return = [];

            foreach ($var as $k => $v) {
                $return[$k] = self::export($v, $maxDepth - 1);
            }

            return $return;
        }

        if ( ! $isObj) {
            return $var;
        }

        $return = new \stdClass();
        if ($var instanceof \DateTimeInterface) {
            $return->__CLASS__ = get_class($var);
            $return->date      = $var->format('c');
            $return->timezone  = $var->getTimezone()->getName();

            return $return;
        }

        $return->__CLASS__ = ClassUtils::getClass($var);

        if ($var instanceof Proxy) {
            $return->__IS_PROXY__          = true;
            $return->__PROXY_INITIALIZED__ = $var->__isInitialized();
        }

        if ($var instanceof \ArrayObject || $var instanceof \ArrayIterator) {
            $return->__STORAGE__ = self::export($var->getArrayCopy(), $maxDepth - 1);
        }

        return self::fillReturnWithClassAttributes($var, $return, $maxDepth);
    }
1253439
public function setNestedType($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto::class);
        $this->nested_type = $arr;
        $this->has_nested_type = true;

        return $this;
    }
1022214
public static function varExport($var, $indentLevel = 1) {
        $output = array();
        if (is_array($var)) {
            $exploded = explode("\n", var_export($var, true));
            $count = count($exploded);
            $output = array(current($exploded));
            $lineNo = 1;
            while ($line = next($exploded)) {
                $lineNo++;
                if ($lineNo === $count) {
                    $output[] = str_repeat(' ', $indentLevel * 4) . $line;
                    break;
                }
                $split = str_split($line);
                $spaces = 0;
                while ($char = next($split)) {
                    if ($char !== ' ') break;
                    $spaces++;
                }
                $output[] = str_repeat('    ', $indentLevel + 1) . str_repeat('    ', $spaces / 2) . substr($line, ($spaces ? $spaces + 1 : 0));
            }
        }
        return implode("\n", $output);
    }
538810
private function getMaxDepth()
    {
        $maxDepth = 3;

        $extra = $this->composer->getPackage()->getExtra();

        if (array_key_exists(self::KEY_MAX_DEPTH, $extra)) {
            $maxDepth = $extra[self::KEY_MAX_DEPTH];
            $minDepth = $this->getMinDepth();

            if (is_int($maxDepth) === false     /* Must be an integer */
                || $maxDepth <= $minDepth       /* Larger than the minimum */
                || is_float($maxDepth) === true /* Within the boundaries of integer */
            ) {
                $message = vsprintf(
                    self::MESSAGE_ERROR_WRONG_MAX_DEPTH,
                    array(
                        'key' => self::KEY_MAX_DEPTH,
                        'min' => $minDepth,
                        'given' => var_export($maxDepth, true),
                    )
                );

                throw new \InvalidArgumentException($message);
            }
        }

        return $maxDepth;
    }
259773
static function dumpVariable( $var )
    {
        // If we have var_export (PHP >= 4.2.0) we use the instead
        // provides better output, doesn't require output buffering
        // and doesn't get mangled by Xdebug

        // dl: we should always use 'var_dump' since 'var_export' is
        // unable to handle recursion properly.
        //if ( function_exists( 'var_export' ) )
        //    return var_export( $var, true );

        ob_start();
        var_dump( $var );
        $variableContents = '';
        if ( extension_loaded( 'xdebug' ) )
           $variableContents = self::XDEBUG_SIGNATURE;
        $variableContents .= ob_get_contents();
        ob_end_clean();
        return $variableContents;
    }
697330
public function hasAncestorTag($tagName, $maxDepth = 3, callable $filterFn = null)
    {
        $depth = 0;
        $node = $this;

        while ($node->parentNode) {
            if ($maxDepth > 0 && $depth > $maxDepth) {
                return false;
            }

            if ($node->parentNode->nodeName === $tagName && (!$filterFn || $filterFn($node->parentNode))) {
                return true;
            }

            $node = $node->parentNode;
            $depth++;
        }

        return false;
    }
11100
public static function var_dump($var, $return = false, $expandLevel = 1)
    {
        self::$hasArray = false;
        $toggScript = 'var colToggle = function(toggID) {var img = document.getElementById(toggID);if (document.getElementById(toggID + "-collapsable").style.display == "none") {document.getElementById(toggID + "-collapsable").style.display = "inline";setImg(toggID, 0);var previousSibling = document.getElementById(toggID + "-collapsable").previousSibling;while (previousSibling != null && (previousSibling.nodeType != 1 || previousSibling.tagName.toLowerCase() != "br")) {previousSibling = previousSibling.previousSibling;}} else {document.getElementById(toggID + "-collapsable").style.display = "none";setImg(toggID, 1);var previousSibling = document.getElementById(toggID + "-collapsable").previousSibling; while (previousSibling != null && (previousSibling.nodeType != 1 || previousSibling.tagName.toLowerCase() != "br")) {previousSibling = previousSibling.previousSibling;}}};';
        $imgScript = 'var setImg = function(objID,imgID,addStyle) {var imgStore = ["data:image/png;base64,' . self::$icon_collapse . '", "data:image/png;base64,' . self::$icon_expand . '"];if (objID) {document.getElementById(objID).setAttribute("src", imgStore[imgID]);if (addStyle){document.getElementById(objID).setAttribute("style", "position:relative;left:-5px;top:-1px;cursor:pointer;");}}};';
        $jsCode = preg_replace('/ +/', ' ', '<script>' . $toggScript . $imgScript . '</script>');
        $html = '<pre style="margin-bottom: 18px;' .
            'background: #f7f7f9;' .
            'border: 1px solid #e1e1e8;' .
            'padding: 8px;' .
            'border-radius: 4px;' .
            '-moz-border-radius: 4px;' .
            '-webkit-border radius: 4px;' .
            'display: block;' .
            'font-size: 12.05px;' .
            'white-space: pre-wrap;' .
            'word-wrap: break-word;' .
            'color: #333;' .
            'font-family: Menlo,Monaco,Consolas,\'Courier New\',monospace;">';
        $done  = array();
        $html .= self::recursiveVarDumpHelper($var, intval($expandLevel), 0, $done);
        $html .= '</pre>';

        if (self::$hasArray) {
            $html = $jsCode . $html;
        }

        if (!$return) {
            echo $html;
        }

        return $html;
    }
784043
public static function range($value, $min, $max): int
    {
        $value = Filter::int($value);
        $min = Filter::int($min);
        $max = Filter::int($max);

        return Vars::limit($value, $min, $max);
    }
1164908
public static function numberLimit($val, $min, $max)
    {
        return ($val > $min ? ($val < $max ? $val : $max) : $min);
    }
81627
public int maxDepth()
    {
        Map<DFAState<T>,Integer> indexOf = new NumMap<>();
        Map<DFAState<T>,Long> depth = new NumMap<>();
        Deque<DFAState<T>> stack = new ArrayDeque<>();
        maxDepth(root, indexOf, stack, depth);
        long d = depth.get(root);
        assert d >= 0;
        if (d >= Integer.MAX_VALUE)
        {
            return Integer.MAX_VALUE;
        }
        else
        {
            return (int) d;
        }
    }
324948
public static function dumpScalar($var, $maxValueLen)
    {
        switch (true) {
            case is_null($var):
                $val = 'null';
                break;
            case is_bool($var):
                $val = ($var ? 'true' : 'false');
                break;
            case is_integer($var):
                $val = sprintf('%d', $var);
                break;
            case is_float($var):
                $val = sprintf('%F', $var);
                break;
            case is_string($var):
                $val = self::formatString($var, $maxValueLen);
                break;
            case is_resource($var):
                $val = 'resource (' . get_resource_type($var) . ')';
                break;
            default:
                $val = gettype($var) . ' (unknown scalar type)';
                break;
        }
        return $val;
    }
1296750
public function _validation_numeric_max($val, $max_val)
	{
		return $this->_empty($val) || floatval($val) <= floatval($max_val);
	}
461448
public static function dttm2br($var,$separador="/"){
			if(preg_match('/([0-9]{4})\-([0-9]{2})\-([012][0-9]|3[01])[ ]([0-9]{2}):([0-9]{2}):([0-9]{2})/', $var, $array)){
				$dt = self::checkDtbr($array[3], $array[2], $array[1],$separador);
				if($dt && ($array[4] != '00' || $array[5] != '00'))
					$dt .= '  '.$array[4].':'.$array[5];
				return $dt;
			}
		}
131146
public function setImageWidth($minwidth, $maxwidth)
    {
        $this->setImageMin($minwidth, $this->_minheight);
        $this->setImageMax($maxwidth, $this->_maxheight);
        return $this;
    }
1368750
protected function validate_negative_int( $var, $include_zero = false, $min = null, $max = null ) {
		$validate = $this->validate_int( $var, $min, $max );
		if ( true === $validate ) {
			return $this->validate_negative( $var, $include_zero );
		}

		return $validate;
	}
668756
public function maxDepth($value = null)
    {
        if (func_num_args()) {
            $this->maxDepth = $value;
            return $this;
        }
        return $this->maxDepth;
    }
690545
public static function dt2br($var,$separa="/"){
			if(preg_match('/([012][0-9]|3[01]|[0-9])\/([0-9]|[0-9]{2})\/([0-9]{4})/', $var, $array))
				return self::checkDtbr($array[1], $array[2], $array[3],$separa);
			else if(preg_match('/([0-9]{4})\-([0-9]|[0-9]{2})\-([012][0-9]|3[01]|[0-9])/', $var, $array))
				return self::checkDtbr($array[3], $array[2], $array[1],$separa);
		}