MysqlndUhConnection::getThreadId

(PECL mysqlnd-uh >= 1.0.0-alpha)

MysqlndUhConnection::getThreadIdReturns the thread ID for the current connection

说明

public MysqlndUhConnection::getThreadId ( mysqlnd_connection $connection ) : int

Returns the thread ID for the current connection.

参数

connection

Mysqlnd connection handle. Do not modify!

返回值

Connection thread id.

范例

Example #1 MysqlndUhConnection::getThreadId() example

<?php
class proxy extends MysqlndUhConnection {
 public function 
getThreadId($res) {
  
printf("%s(%s)\n"__METHOD__var_export(func_get_args(), true));
  
$ret parent::getThreadId($res);
  
printf("%s returns %s\n"__METHOD__var_export($rettrue));
  return 
$ret;
 }
}
mysqlnd_uh_set_connection_proxy(new proxy());

$mysqli = new mysqli("localhost""root""""test");
var_dump($mysqli->thread_id);
?>

以上例程会输出:

proxy::getThreadId(array (
  0 => NULL,
))
proxy::getThreadId returns 27646
int(27646)

参见

相关文章
php eventbufferevent returns the current cipher name of the ssl connectionphp eventbufferevent returns version of cipher used by current ssl connectionphp eventbufferevent returns the name of the protocol used for current ssl connectionphp evloop returns the current event loop time php apd 函数 returns the current call stack as an arrayphp ibm db2 函数 returns the auto generated id of the last insert query that successfully executed on this connectionphp maxdb 函数 returns the thread id for the current connectionphp mysqlnd qc 函数 returns information on the current handler the number of cache entries and cache entries if availablephp odbc 函数 returns information about a current connectionphp posix 函数 return the real group id of the current processphp rpm reader 函数 returns a string representing the current version of the rpmreader extensionphp mongocursor returns the current result s id or its index within the result setphp mongogridfscursor returns the current filephp mysqlnduhconnection returns the default character set for the database connectionphp mysqlnduhconnection escapes special characters in a string for use in an sql statement taking into account the current charset of the connectionphp mysqlnduhconnection returns a string representing the type of connection usedphp mysqlnduhconnection returns the auto generated id used in the last queryphp mysqlnduhconnection returns statistics about the client connectionphp mysqlnduhconnection returns the thread id for the current connectionphp weakmap returns the current value under iteration
关注编程学问公众号