Rambo
July 24th, 2008The Function Part Two
A while back I went through a phase where I was (mildly) obsessed with Rambo (prompted by the launch of the superbly violent John Rambo - i.e. Rambo 4). During this period I wrote a function entitled rambo which I decided to post on PHP.net for all to admire.
The destroyer of all variables, it was a method that could obliterate anything that was place in it’s path (or in it’s parenthesis as the case may be). Of course it was meant as joke, and after time I’ve even post-rationalised it to a piece of reflective coding art (maybe I’ll divulge later). What’s amazed me though is the wrath of distaste I’ve recieved from fellow coders. There’s been subsequent posts on PHP.net pointing out it’s faults and I’ve even recieved emails detailing what an ill concieved piece of coding it is.
As a result I’ve decided to post the beauty up here for all to enjoy (of course to their programming distaste) - abuse as you will!
(Original post - http://uk2.php.net/manual/en/function.unset.php#81839)
/**
* function rambo (first blood)
*
* Completely and utterly destroys everything,
* returning the kill count of victims
*
* @param It don't matter, it’s Rambo baby
* @return Integer Body count (but any less than 500 and
* it's not really worth mentioning)
*/
function rambo() {
// Get the victims and initiate that body count status
$victims = func_get_args();
$body_count = 0;
// Kill those damn punks
foreach($victims as $victim) {
if($death_and_suffering = @unset($victim)) {
$body_count++;
}
}
// How many kills did Rambo tally up on this mission?
return($body_count);
}