pthreads - PHP thread - run method not being called -


for reason run method not being called? ideas i'm going wrong?

<?php      class workerthread extends thread     {         private $i = 0;          public function __construct( $i )         {             $this->i = $i;         }          public function run()         {             $a = 0;             while( $a < 100 )             {                 file_put_contents( "test" . $this->i . ".txt", $a, file_append );                                     sleep( 5 );             }         }      }      $workers = array();      ( $i = 0; $i < 3; $i++ )     {         $workers[ $i ] = new workerthread( $i );         $workers[ $i ]->start();     }  ?> 

in while loop, $a never changes , causes infinite loop (it's equal zero).


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -