array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'es', ), 'this' => array ( 0 => 'thread.getcurrentthread.php', 1 => 'Thread::getCurrentThread', ), 'up' => array ( 0 => 'class.thread.php', 1 => 'Thread', ), 'prev' => array ( 0 => 'thread.getcreatorid.php', 1 => 'Thread::getCreatorId', ), 'next' => array ( 0 => 'thread.getcurrentthreadid.php', 1 => 'Thread::getCurrentThreadId', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/pthreads/thread/getcurrentthread.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL pthreads >= 2.0.0)
Thread::getCurrentThread — Identification
Return a reference to the currently executing Thread
Esta función no tiene parámetros.
An object representing the currently executing Thread
Ejemplo #1 Return the currently executing Thread
<?php
class My extends Thread {
public function run() {
var_dump(Thread::getCurrentThread());
}
}
$my = new My();
$my->start();
?>
El resultado del ejemplo sería:
object(My)#2 (0) { }