PHP Classes

Weird code

Recommend this page to a friend!

      Multi-threading in PHP  >  All threads  >  Weird code  >  (Un) Subscribe thread alerts  
Subject:Weird code
Summary:How would this ever work??
Messages:3
Author:rudie dirkx
Date:2012-07-29 11:31:10
Update:2012-07-31 07:22:09
 

  1. Weird code   Reply   Report abuse  
Picture of rudie dirkx rudie dirkx - 2012-07-29 11:31:10
function runing($tv_sec=0, $tv_usec=100000) {
static $buffers = array();
static $buffers_headers_passed = array();

/* internal call for reset of threads & connections */
if ( $parent === '!@$%^&*()_+INTERNAL_THREAD_RESET!@$%^&*()_+' ) {


Where does $parent come from? It's undefined.

When I run example.php I get ~ 60 notices...

  2. Re: Weird code   Reply   Report abuse  
Picture of Sjoerd Wenker Sjoerd Wenker - 2012-07-29 15:59:49 - In reply to message 1 from rudie dirkx
I guess he changed the names of the params and functions. Above all the functions there are different names than the function itself.

Change $parent to $tv_sec and it will work.

  3. Re: Weird code   Reply   Report abuse  
Picture of Bijaya Kumar  Behera Bijaya Kumar Behera - 2012-07-31 07:22:09 - In reply to message 2 from Sjoerd Wenker
Hi Sjoerd
You are right !, i have foget to change it .