-
-
Save talpah/ff573a15ea88b38cafa8 to your computer and use it in GitHub Desktop.
Just noticed that sad() is not called on a class instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$thefeels = new Feelings(); | |
function sad() { | |
global $thefeels; | |
return $thefeels->is_checked() ? $thefeels : $thefeels->is_sad(); | |
} | |
class Feelings { | |
private $sad = true; | |
private $feelings_checked = false; | |
public function is_sad() { | |
$this->feelings_checked = true; | |
return $this->sad; | |
} | |
public function is_checked() { | |
return $this->feelings_checked; | |
} | |
public function stop() { | |
$this->sad = false; | |
} | |
} | |
function beAwesome() { | |
// TODO: own version | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment