PHP 8.1.28 Released!

Thread::isStarted

(PECL pthreads >= 2.0.0)

Thread::isStartedDétection de statut

Description

public Thread::isStarted(): bool

Indique si le Thread référencé a été démarré.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Cette fonction retourne true en cas de succès ou false si une erreur survient.

Exemples

Exemple #1 Indique si le Thread référencé a été démarré

<?php
$worker
= new Worker();
$worker->start();
var_dump($worker->isStarted());
?>

L'exemple ci-dessus va afficher :

bool(true)

add a note

User Contributed Notes 1 note

up
4
ricardo dot boss at web dot de
7 years ago
Even if you kill() a thread, the isStarted() method will still return true.
To Top