How to use Thread for php target?

how to use Thread for php target?
current I have some socket code use Tread class,

Thread.create(threadListen);

function threadListen() {
		while (true) {
			try {
				var text = socket.input.readLine();
				console.write(text + '\n');
			} catch (z:Dynamic) {
				console.write('Connection lost.\n');
				console.close();
				return;
			}
		}
	}

but Tread class only available neko,cpp,lua?
how to implement in php target ?

Is it possible to use thread in plain php?

may be php7.2 have

More or less, The pthreads extension cannot be used in a web server environment. Threading in PHP is therefore restricted to CLI-based applications only.