Re: [Fwd: PHP Peer - Benchmark - timer.php]
| From: | Alan Knowles | Date: | Sun, 14 Sep 2003 02:22:44 +0000 |
| Subject: | Re: [Fwd: PHP Peer - Benchmark - timer.php] | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-21483@lists.php.net to get a copy of this message | ||
or even simpler.. ?
$http = ($set_http !== null) ? $set_http :
isset($_SERVER['SERVER_PROTOCOL'])
|| isset($GLOBALS['HTTP_SERVER_VARS']['SERVER_PROTOCOL']);
Marshall Roch wrote:
Sebastian Bergmann wrote:-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.comI don't know what this is doing, but I would do it as:function getOutput($set_http=null) { if (function_exists('version_compare') && version_compare(phpversion(), '4.1', 'ge')) { $http = isset($_SERVER['SERVER_PROTOCOL']); } else { global $HTTP_SERVER_VARS; $http = isset($HTTP_SERVER_VARS['SERVER_PROTOCOL']); }if (!is_null($set_http)) $http = $set_http;function getOutput($set_http=null) { if (!is_null($set_http)) { $http = $set_http; } else { if (function_exists('version_compare') && version_compare(phpversion(), '4.1', 'ge')) { $http = isset($_SERVER['SERVER_PROTOCOL']); } else { global $HTTP_SERVER_VARS; $http = isset($HTTP_SERVER_VARS['SERVER_PROTOCOL']); } } }No sense in doing all of that checking if you're just going to overwrite it.