Created
          September 1, 2015 13:56 
        
      - 
      
- 
        Save mikemix/8d66ee1eb8ee0d101116 to your computer and use it in GitHub Desktop. 
Revisions
- 
        Mike Zukowsky created this gist Sep 1, 2015 .There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ <?php class Person implements \JsonSerializable { public function __construct($name, $surname) { $this->name = $name; $this->surname = $surname; } public function jsonSerialize() { return [ 'name' => $this->name, 'surname' => $this->surname, ]; } } var_dump(json_encode(new Person('Jan', 'Kowalski'))); 
 Mike Zukowsky
              created
            
            this gist
            
              Mike Zukowsky
              created
            
            this gist