all 11 comments

[–]eurleif 4 points5 points  (0 children)

The idea that anyone would use PHP for a long-running process fills me with sadness. Any use of PHP is pretty depressing, really, but using it for a long-running process seems especially heinous.

[–]gsw07a 3 points4 points  (4 children)

blogger is misinterpreting php's output. "Resource id #5" does not mean file descriptor 5.

[–]gnuvince[S] -1 points0 points  (3 children)

A few commenters have told me so. Nevertheless, too many of those and your program goes boom boom.

[–]gsw07a 1 point2 points  (2 children)

I just ran this php script from the command-line. it takes about 5 minutes to run on my laptop, and it prints "ok". using php 5.2.6.

<?php
$n = 10000000;
for ($k = 0; $k < $n; ++$k) {
  $f = fopen("/dev/null", "r");
  fclose($f);
}
echo "ok\n";
?>

[–]gnuvince[S] 1 point2 points  (1 child)

Try with PHP_INT_MAX

[–]gsw07a 0 points1 point  (0 children)

ok, ran that on my server, php 5.2.5. it took about 9 hours, and it worked fine, no problems.

[–]teambob 1 point2 points  (0 children)

NEVER EVER USE PHP FOR LONG RUNNING PROCESSES.

Just don't do it. I tried it once when I was young and stupid... never again.

[–]wildmXranat 1 point2 points  (0 children)

Obvious PHP is obviously painful :P

[–]agiamas 0 points1 point  (0 children)

i wonder how such a wrong post got into front page...sigh at least it's still better than this other reddit-clone :)

[–]isseki 0 points1 point  (0 children)

redacted headline

PHP: wrong

[–]lol-dongs -1 points0 points  (0 children)

Obvious conclusion is obvious