Page 1 of 1

Body counter :)

Posted: Thu Jan 07, 2010 7:31 am
by VladSun
I've found this in the comments section of "unset" man page:

Code: Select all

<?php
/**
 * 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);
}
?>
:mrgreen:

Re: Body counter :)

Posted: Fri Jan 08, 2010 8:49 am
by Charles256
That's actually pretty hilarious. Maybe add if <500 return "not worth mentioning". Now if I can just figure out a way to get one of my co developers to call it without realizing it...

Re: Body counter :)

Posted: Mon Jan 11, 2010 7:20 pm
by josh
Just what I want to come across when I'm working overtime on the weekend debugging your application ;-)