note 116506 added to function.version-compare
| From: | rlerne at gmail dot com | Date: | Wed, 14 Jan 2015 21:58:27 +0000 |
| Subject: | note 116506 added to function.version-compare | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-201427@lists.php.net to get a copy of this message | ||
What PHP.net page is any good without a classy userland implementation of a function already
provided by PHP? Generally, there are pseudo-benchmarks and reasons why you'd want to use their
"far superior" implementations.
Since exit is a difficult construct to implement, and exit cannot be called using variable
functions, this function is <blink>BETTER</blink>.
While you cannot use this code without parentheses, you'll find that this exit function
improves your site's performance with at least 25 teraflops of flux computing power!
I used to be a fan of die;, I even tried to use exit;, but now; I'm a true-blue userland_exit()
fan, now with 20% more.*
*-Over the top competing brand.
<?php
function userland_exit($death_call=null)
{
if (version_compare(PHP_VERSION,'4.2.0','<'))
echo $death_call;
elseif (!is_int($death_call))
echo $death_call;
error_reporting(0);
trigger_error(null,E_USER_ERROR);
}
userland_exit("I'm dead");
?>
----
Server IP: 72.52.91.14
Probable Submitter: 50.254.6.113
----
Manual Page -- http://php.net/manual/en/function.version-compare.php
Edit -- https://master.php.net/note/edit/116506
Del: integrated -- https://master.php.net/note/delete/116506/integrated
Del: useless -- https://master.php.net/note/delete/116506/useless
Del: bad code -- https://master.php.net/note/delete/116506/bad+code
Del: spam -- https://master.php.net/note/delete/116506/spam
Del: non-english -- https://master.php.net/note/delete/116506/non-english
Del: in docs -- https://master.php.net/note/delete/116506/in+docs
Del: other reasons-- https://master.php.net/note/delete/116506
Reject -- https://master.php.net/note/reject/116506
Search -- https://master.php.net/manage/user-notes.php