Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class PostHandler{
- private $data;
- private $current;
- public function __set($key, $value){
- $this->data[$key] = $value;
- }
- public function __get($key){
- $this->current = $this->data[$key];
- return $this;
- }
- public function submit(){
- echo 'Posting message: ' . $this->current;
- }
- }
- $postHandler = new PostHandler();
- $postHandler->vincent = 'vincent';
- $postHandler->vincent->submit();
Add Comment
Please, Sign In to add comment