note 116506 deleted from function.version-compare by cmb
| From: | cmb@php.net | Date: | Mon, 26 Oct 2020 16:14:05 +0000 |
| Subject: | note 116506 deleted from function.version-compare by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215659@lists.php.net to get a copy of this message | ||
Note Submitter: rlerne at gmail dot com
----
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");
?>