Skip to content

Instantly share code, notes, and snippets.

@dlsniper
Last active September 21, 2015 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlsniper/55d9c49b98c931e4d657 to your computer and use it in GitHub Desktop.
Save dlsniper/55d9c49b98c931e4d657 to your computer and use it in GitHub Desktop.
Inno solution for sadness
<?php
class human {
public function stop() {
print("https://youtu.be/DgvePeDIt3Y");
}
}
function sad() {
$return = isset($GLOBALS["sad_called"]) && $GLOBALS["sad_called"] === true ? new human() : true;
$GLOBALS["sad_called"] = true;
return $return;
}
function beAwesome() {
print(" Who's your daddy?\n");
}
if (sad()===true) {
sad()->stop();
beAwesome();
}
<?php
function sad() {
$return = isset($GLOBALS["sad_called"]) && $GLOBALS["sad_called"] === true ? "" : true;
$GLOBALS["sad_called"] = true;
return $return;
}
function stop() {
print("https://youtu.be/DgvePeDIt3Y");
}
function beAwesome() {
print(" Who's your daddy?\n");
}
if (sad()===true) {
sad().stop();
beAwesome();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment