title: json string to php object via reflection/ like jackson mapper
body: <p>Im a fan of the jackson mapper in Java, and I'm a bit lost without it in php. I would like an equivalent.</p>
  
  <p>So far the closest I have come across is this, however, it requires the fields to be declared as public, and I dont want to do that:</p>
  
  <p><a href="https://github.com/netresearch/jsonmapper" rel="nofollow">https://github.com/netresearch/jsonmapper</a></p>
  
  <p>I want something that does everything that that does, with this sort of code:</p>
  
  <pre><code>&lt;?php
  class Contact
  {
      /**
       * Full name
       * @var string
       */
      public $name; //&lt;- I want this to be private
  
      /**
       * @var Address //&lt;- and this
       */
      public $address;
  }
  
  class Address
  {
      public $street;&lt;- and this
      public $city;&lt;- and this
  
      public function getGeoCoords()
      {
          //do something with the $street and $city
      }
  }
  
  $json = json_decode(file_get_contents('http://example.org/bigbang.json'));
  $mapper = new JsonMapper();
  $contact = $mapper-&gt;map($json, new Contact());
  </code></pre>
  
  <p>Json from <code>file_get_contents</code>:</p>
  
  <pre><code>{
      'name':'Sheldon Cooper',
      'address': {
          'street': '2311 N. Los Robles Avenue',
          'city': 'Pasadena'
       }
  }
  </code></pre>
  
  <p>So I dont want to be writing individual constructors, or anything individual at all.</p>
  
  <p>Im sure there would be something that does this out of the box using reflection?</p>