return index of highest used byte.
(A plain count would wrongly return 2 if we only used byte 0 and byte 4)
@param array $temp
@return int
185726
protected function dataLength($temp)
   {
      if(count($temp) == 0) return 0;
      
      $arKeys = array_keys($temp);
      sort($arKeys);
      $dataLength = $arKeys[count($arKeys)-1];
      return $dataLength+1;
   }
792143
public static function sortByKey($array, $key, $useDotSyntax = false)
    {
        uasort($array, function ($a, $b) use ($key, $useDotSyntax) {
            $valueA = self::get($a, $key, null, $useDotSyntax);
            $valueB = self::get($b, $key, null, $useDotSyntax);
            if ($valueA == $valueB) {
                return 0;
            }

            return ($valueA < $valueB) ? -1 : 1;
        });

        return $array;
    }
429929
public function max($max=null)
    {
        $max = LambdaUtils::toSelectCallable($max);
        $temp = $this->select($max)->toArray();
        return max($temp);
    }
1243468
function _get_index($key)
	{
		$l = strlen($key);
		$h = $this->hash_base;
		while ($l--)
		{
			$h += ($h << 5);
			$h ^= ord($key[$l]);
			$h &= 0x7fffffff;
		}
		return ($h % $this->hash_prime);
	}
169833
public function getDataLength($index)
	{
		if (isset($this->_list[$index])) {
			return $this->_list[$index]->Size;
		}
		return 0;
	}
379327
public static function getReadableSize($bytes)
    {
        $unit = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
        $exp = floor(log($bytes, 1024)) | 0;

        return round($bytes / (pow(1024, $exp)), 2) . " $unit[$exp]";
    }
466732
@Override
    public V getBest(byte[] b, int offset, int len) {
        return getBest(0, b, offset, len);
    }
275436
private function index(string $char): int {
        if (isset($this->index[$char])) {
            return $this->index[$char];
        }

        $this->index_count++;
        $this->index[$char] = $this->index_count;
        return $this->index_count;
    }
1272128
public function EntryRead($Bytes = -1)
    {
        $Actual = $this->EntryActualSize();
        if ($Bytes < 0 || $Bytes > $Actual) {
            $Bytes = $Actual;
        }
        return $Bytes > 0 ? $this->ZipObject->getFromIndex($this->Index, $Bytes) : '';
    }
328150
protected function getRecipientIndex(array $context): int
    {
        $recipientIndex = 0;

        if (isset($context['recipient_index']) && \is_int($context['recipient_index'])) {
            $recipientIndex = $context['recipient_index'];
        }

        return $recipientIndex;
    }
532898
public function getByteValue() : int
    {
        $bits = (array)$this->getValue();
        return array_reduce($bits, function ($carry, $item) {
            return $carry | (int)$item;
        }, 0);

    }
1178173
public int lastIndexOf(byte b) {
        byte[] bytes = getByteArray();
        int offset = getByteOffset();
        int i = getByteLength() - 1;
        while (i >= 0 && bytes[offset + i] != b) i--;
        return i;
    }
1129522
public static function getMaxValueLength(array $array)
    {
        $maxValueLength = '0';
        foreach ($array as $value) {
            $currentLength = static::getVisibleStringLength($value);

            if ($currentLength > $maxValueLength) {
                $maxValueLength = $currentLength;
            }
        }

        return $maxValueLength;
    }
672340
private function getTmpPath(): string
    {
        $tmpDir = sys_get_temp_dir();
        if (!empty($this->prefix)) {
            $tmpDir .= '/' . $this->prefix;
        }
        $tmpDir .= '/' . $this->id;
        return $tmpDir;
    }
297090
function _getTempDir()
    {
        $tmp_locations = array('/tmp', '/var/tmp', 'c:\WUTemp', 'c:\temp',
                               'c:\windows\temp', 'c:\winnt\temp');

        /* Try PHP's upload_tmp_dir directive. */
        $tmp = ini_get('upload_tmp_dir');

        /* Otherwise, try to determine the TMPDIR environment variable. */
        if (!strlen($tmp)) {
            $tmp = getenv('TMPDIR');
        }

        /* If we still cannot determine a value, then cycle through a list of
         * preset possibilities. */
        while (!strlen($tmp) && count($tmp_locations)) {
            $tmp_check = array_shift($tmp_locations);
            if (@is_dir($tmp_check)) {
                $tmp = $tmp_check;
            }
        }

        /* If it is still empty, we have failed, so return false; otherwise
         * return the directory determined. */
        return strlen($tmp) ? $tmp : false;
    }
554779
public function get(int $x, int $y) : int
    {
        return $this->bytes[$y][$x];
    }
734074
public static function getBytes($key, $default = null): ?int
    {
        $value = ini_get($key);

        if ($value === false || $value === '') {
            return $default;
        }

        if ($value === '-1') {
            return -1;
        }

        $unit = preg_replace('/[^bkmgtpezy]/i', '', $value);
        $size = preg_replace('/[^0-9\.]/', '', $value);

        return ((int) $size) * ($unit ? pow(1024, mb_stripos('bkmgtpezy', $unit[0])) : 1);
    }