Code For All PHP Developers
foreach ($problems as $problem) {
$problemSolved = $this->solve($problem);
if (!$problemSolved) {
$this->execute(self::SHOOT);
}
}
Written by Antony D'Andrea
Related protips
9 Responses

foreach ($problems as $problem) {
$this->solve($problem) || $this->execute(self::SHOOT);
}
To make the situation a little more worrying ;)
over 1 year ago
·

Do I die()
after I shoot myself?
over 1 year ago
·

that should be placed inside a recursive function.
all problems shoud be solved
over 1 year ago
·

@narven Nope. Iteration into infinity.
over 1 year ago
·

lol
over 1 year ago
·
love this !
over 1 year ago
·
@mauris lol
over 1 year ago
·

@mauris no, you will just exit;
life and continue
to cemetery :)
over 1 year ago
·

You forgot something!
foreach ($problems as $problem) {
$problemSolved = $this->solve($problem);
if (!$problemSolved) {
$this->execute(self::SHOOT);
}
$problems[] = new Problem();
}
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Related Tags
#php
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#