Mam taki kod testowy
<?php class CheckIpThread extends Thread { private $ip; public $data = null; public function __construct ($ip_to_check) { $this->ip = $ip_to_check; } public function run () { $this->data = th($this->ip); } } $threads = []; for($a=0;$a<=1000;$a=$a+100) {licz($a);} function licz($co) { for($a=0;$a<=100;$a++) {//echo_($a); $thread = new CheckIpThread($co+$a); $threads []= $thread; $thread->start(); } foreach ($threads as $thread) { $thread->join(); } foreach ($threads as $thread) { echo_($thread->data); } } function th($wsad) {return $wsad;//jakies tam obliczenia } function echo_($tekst,$def=0) { if($def===0) if($def===1) } ?>
Kod wypluwa liczby od 0 do 799 i przestaje dalej sie wykonywać cały czas przegladarka "kręci" i na tym sie temat kończy.
O co kaman?