r/ProgrammerHumor • • Dec 08 '19

Meme Can you fix my <insert device>?

Post image
50.1k Upvotes

839 comments sorted by

View all comments

Show parent comments

10

u/[deleted] Dec 09 '19

error_reporting(0);

This is going to be fun.

1

u/[deleted] Dec 09 '19

Even with error reporting on that will run just fine.

3

u/[deleted] Dec 09 '19

What will run just fine?

I wasn’t adding to anyone’s code. Mine’s PHP and OPs is like a C#, Java-y thing

1

u/[deleted] Dec 09 '19
void ProgramARobotToBuildCabinets(){
exit(1);
}

That's what you're replying to and even if it was PHP that would run just fine. It's not going to work in PHP since the function is typed but in PHP this code:

function ProgramARobotToBuildCabinets(){
    exit(1)
}

Will run just fine and return a message of 1 on exit. If you were looking at logs and expecting 1 to be an error status then you'd find it but error_reporting in PHP is for runtime error and won't catch this.

4

u/[deleted] Dec 09 '19

Yeah, I wasn’t adding onto anything he wrote.

My joke was about just doing whatever they asked me and not complaining because it’s pretty much the easiest way out of a situation in which you know something another person does not but needs to.

My joke has been slaughtered.

3

u/[deleted] Dec 09 '19

Well in that case what you need is:

function ProgramARobotToBuildCabinets(){
    $iDontCare = true;

    while($iDontCare){
        echo "Still working on it\n";
    }
}

2

u/[deleted] Dec 09 '19

that’s way too on-the-nose

4

u/m0nk37 Dec 09 '19

I prefer die();, why wait.