Re: Cannot understand this libcurl script, any help?



Iván Sánchez Ortega wrote:
Ming wrote:

do {
curl_multi_exec($mh,$running);
} while ($running > 0);
[...]
What does $running mean? $running is NULL at first,

No. It's undeclared at first.

how it becomes a value which is greater than zero?

http://www.php.net/manual/en/function.curl-multi-exec.php

"A reference to a flag to tell whether the operations are still running."

Now, re-read your programming books, looking for anything
on "pass-by-reference parameters". That should clear your mind.


No, $running is null. When you edited the post, you dropped:

$running=null;

As for how it changes - $running is passed by reference. This means if curl_multi_exec changes the value of $running, the real value of $running (not a copy) will change, and you will be able to test it in your do...while loop.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: In search of the perfect Disassembler
    ... > that you re-read yours, but I'm the one with the Lady Bracknell ... That I said "T.M.'s on the money here", as an explicit reference to your ... was actually about providing enough "context" so that posters could fire up ... physics by watching sci-fi on TV"...bloody hell! ...
    (alt.lang.asm)
  • Re: [PATCH] update ctime and mtime for mmaped write
    ... underlying file is modified as a result of a write reference, ... A new address_space flag is introduced: ... If there is no such call and if the underlying file is modified ... I also don't see how an mmap'd block device will get its mtime ...
    (Linux-Kernel)
  • Re: Formula detection - Unique vs Copied?
    ... London Excel Users Conference April 1-2 ... consistency and flag is a well meaning user has changed something they ... Scenario 1 ... referenced like "B4" but you have problems if it is reference in ...
    (microsoft.public.excel.programming)
  • Re: Formula detection - Unique vs Copied?
    ... London Excel Users Conference April 1-2 ... consistency and flag is a well meaning user has changed something they ... Scenario 1 ... referenced like "B4" but you have problems if it is reference in ...
    (microsoft.public.excel.programming)
  • RE: Formula detection - Unique vs Copied?
    ... I want to check for any non-dragged formulas in a range of formulas to check ... consistency and flag is a well meaning user has changed something they ... Scenario 1 ... referenced like "B4" but you have problems if it is reference in different ...
    (microsoft.public.excel.programming)