Body counter :)

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Body counter :)

Post 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:
There are 10 types of people in this world, those who understand binary and those who don't
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Re: Body counter :)

Post 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...
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Body counter :)

Post by josh »

Just what I want to come across when I'm working overtime on the weekend debugging your application ;-)
Post Reply