[PHP] Is PHP truly faster on the JVM?

2008-12-27 Thread John Papas
Lately I've been hearing a lot of people evangelizing that PHP with
Resin is actually much faster than with mod_php, but I cannot find any
benchmark anywhere.

Is it true or just vendor BS?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Universaly Accepted Naming Conventions..?

2008-03-05 Thread John Papas
Are there any in PHP?

It seems like there are those that draw upon the C/unix naming
conventions and those that follow the Java/OO style.

Even PHP's native syntax (like function names pre/post v5) are not consistent.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Exception handling with file()

2008-02-11 Thread John Papas
I need to open a remote file with file() and I would like to put it
inside a try-catch but as far as I can tell file() does not raise an
exception if it fails. The following code:

try {
   $data = file('http://myserver.com/myfile.txt');
   $date = substr($data, 0);
} catch (Exception $e) {
   $data = it failed;
}

echo $data;

echoes a warning:

Warning: file('http://myserver.com/myfile.txt') [function.file]:
failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Handle time-outs and errors with file()

2008-01-29 Thread John Papas
I'm using file() to get the contents of a remote page in my script but
I cannot find any information regarding how I could *gracefully*
handle a broken network connection or even a time-out (slow
connection).

Is there a way?

---
Example:
$menu = file('http://www.remotesite.org/mypage.html');
foreach ($menu as $line_num = $line) {
echo $line.\n;
}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Closures in PHP

2008-01-10 Thread John Papas
Is there any functionality in PHP similar to closures?

Are there any plans to add it..?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php