Move the internal cursor until it reaches given string

@param  string $str String to reach
@return void
189327
protected function skipToString($str)
	{
		while (++$this->i < $this->cnt && $this->tokens[$this->i] !== $str);
	}
727544
public function append($str)
    {
        $value = $this->val();
        $this->val($value . $str);

        return $this;
    }
360643
public static function udfLocate($str, $substr, $offset = 0)
    {
        // SQL's LOCATE function works on 1-based positions, while PHP's strpos works on 0-based positions.
        // So we have to make them compatible if an offset is given.
        if ($offset > 0) {
            $offset -= 1;
        }

        $pos = strpos($str, $substr, $offset);

        if ($pos !== false) {
            return $pos + 1;
        }

        return 0;
    }
1074542
protected function freeResult($cursor = null)
	{
		$this->executed = false;

		if ($cursor instanceof \mysqli_result)
		{
			$cursor->free_result();
		}

		if ($this->prepared instanceof \mysqli_stmt)
		{
			$this->prepared->close();
			$this->prepared = null;
		}
	}
496113
public function addStr($str)
    {
        $str = str_replace($this->tab, '', $str);
        $this->outputStringArray[] = str_repeat($this->tab, $this->tabLevel) . $str;
    }
85017
private function typeCast(&$str)
  {
    if (is_numeric($str)) {
      $cast = intval($str);
      if ($str == (string) $cast) {
        $str = $cast;
      } else {
        $str = floatval($str);
      }
    }
  }
152182
public function write($str)
    {
        if (!is_resource($this->pipes['in'])) {
            throw new Exception_SystemProcessIO("stdin is closed or haven't been opened. Cannot write to process");
        }
        $this->debug('writing '.$str.'+newline into stdin');
        fwrite($this->pipes['in'], $str."\n");
        $this->debugStatus();

        return $this;
    }
840244
public function setStdin(string $str): Process
    {
        $this->spec[self::STDIN] = ["pipe", "r"];
        $this->stdin = $str;
        return $this;
    }
1008629
public function out($str)
    {
        $str = Color::convert($str);
        if ($this->useAnsiColors() === false) {
            $str = Color::strip($str);
        }
        $this->getOutputter()->stdout($str, '');
        if (count(\ob_get_status()) !== 0) {
            ob_flush();
        }
    }
1069458
static private function PositionEndingBraceSQL( 
        string & $str
	) : int {
	
        $ret = -1;
        $search1 = false;
        $search2 = false;
        $level = 0;
        
        // echo "\n PositionEndingBraceSQL( \"{$str}\" ) ";
        
        // skip spaces
        
        for ( $i = 0; $i < strlen( $str ); $i++ ) {
            if ( ! ctype_space( substr( $str, $i, 1 ) ) ) {
                break;
            }
        }
        
        if ( substr( $str, $i, 1 ) == '(' ) {     
        
            // echo "\n '(' detected";
        
            for ( $i = $i + 1 ; $i < strlen( $str ); $i++ ) {     // start with1 in order to skip first brace
            
                // echo "\n $i ->" . substr( $str, $i );
                
                if ( $search1 ) {
                    if ( substr( $str, $i, 1 ) != '"' ) {
                        continue;
                    }
                    $search1 = false;
                    continue;
                }
                
                if ( $search2 ) {
                    if ( substr( $str, $i, 1 ) != "'" ) {
                        continue;
                    }
                    $search2 = false;
                    continue;
                }
                
            
                if ( substr( $str, $i, 1 ) == '"' ) {
                    $search1 = true;                
                    continue;
                }
                
                if ( substr( $str, $i, 1 ) == "'" ) {
                    $search2 = true;                
                    continue;
                }       
                
                if ( substr( $str, $i, 1 ) == "(" ) {
                    // a new brace level was opened
                    $level++;    
                }             
            
                if ( substr( $str, $i, 1 ) == ')' ) {
                    if ( ! $level ) {
                        $ret = $i;
                        break;
                    } 
                    
                    $level --;
                    
                }
                
            }        
        
        }
        
        // echo "\n PositionEndingBraceSQL( ) returns $ret";
        
        return $ret;
	
	}
520876
protected function _write($str)
    {
        $file = $this->alias->resolve($this->_file);
        if (!is_file($file)) {
            $dir = dirname($file);
            /** @noinspection NotOptimalIfConditionsInspection */
            if (!is_dir($dir) && !@mkdir($dir, 0755, true) && !is_dir($dir)) {
                /** @noinspection ForgottenDebugOutputInspection */
                trigger_error("Unable to create $dir directory: " . error_get_last()['message'], E_USER_WARNING);
            }
        }

        //LOCK_EX flag fight with SWOOLE COROUTINE
        if (file_put_contents($file, $str, FILE_APPEND) === false) {
            /** @noinspection ForgottenDebugOutputInspection */
            trigger_error('Write log to file failed: ' . $file, E_USER_WARNING);
        }
    }
323280
public function chunk($str = null)
	{
		if (false === $this->chunked)
		{
			$this->chunked = true;
			$this->header('Transfer-encoding', 'chunked');
			flush();
		}

		if (($body_length = strlen($this->body)) > 0)
		{
			printf("%x\r\n", $body_length);
			$this->sendBody();
			$this->setBody('');
			echo "\r\n";
			flush();
		}

		if (null !== $str)
		{
			printf("%x\r\n", strlen($str));
			echo "$str\r\n";
			flush();
		}

		return $this;
	}
1102834
public function trim($str, $charlist = null)
    {
        return isset($charlist) ? trim($str, $charlist) : trim($str);
    }
442740
public function locate($substr,$str,$which_connection='')
    {
        $which_connection = $which_connection === '' ? $this->default_db : $which_connection;
        $adapter = $this->getAdapter($this->connectionType($which_connection));
        return $adapter->locate($substr, $str);
    }
47115
public function prependInput($str)
    {
        if (!isset($this->bev)) {
            return false;
        }
        return $this->bev->input->prepend($str);
    }
615508
public function slowEquals(self $str){
		
		$l1 = \strlen($this->_Value);
		$l2 = \strlen($str->_Value);
		$diff = $l1 ^ $l2;
		
		for($i = 0; $i < $l1 && $i < $l2; ++$i){
			$diff |= \ord($this->_Value[$i]) ^ \ord($str->_Encoding[$i]);
		}
		
		return $diff === 0;
		
	}
295779
final protected function log($str, $logLevel = 0)
    {
        if (isset($this->logger)) {
            call_user_func($this->logger, $str, $logLevel);
        }
    }