Skip to content

Instantly share code, notes, and snippets.

@motohashi
Created June 13, 2016 07:14
Show Gist options
  • Save motohashi/d18683bf9264752a42c7979400b5af42 to your computer and use it in GitHub Desktop.
Save motohashi/d18683bf9264752a42c7979400b5af42 to your computer and use it in GitHub Desktop.
<?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