Created
June 13, 2016 07:14
-
-
Save motohashi/d18683bf9264752a42c7979400b5af42 to your computer and use it in GitHub Desktop.
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 | |
class Teratail { | |
protected $value; | |
public function __construct($value) { | |
$this->value = $value; | |
} | |
public function getAnswer() { | |
return $this->value; | |
} | |
} | |
$otherProgrammer = new Teratail('be'); | |
$yourQuestion = function ($status) { var_dump( $status . $this->getAnswer()); }; | |
$yourQuestion->call($otherProgrammer, 'happy'); | |
/* | |
-- teratail | |
-- question | |
-- ansewers | |
good++ | |
bestAnser | |
programming | |
issue | |
-- $yourQuestions->makes('otherProgrammer', 'happy'); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment