title: PHP json_decode depth parameter doesn't work
body: <p>PHP's json_decode function has a "depth" parameter, where you can specify how deep it will recurse. But the following code:</p>
  
  <pre><code>test = array(
      'name' =&gt; 'sean',
      'dob' =&gt; '12-20',
      'parents' =&gt; array(
          'father' =&gt; 'tommy',
          'mother' =&gt; 'darcy'
      )
  );
  
  foreach(range(1, 3) as $depth) {
      echo "-----------------\n depth: $depth\n";
      print_r(json_decode(json_encode($test), true, $depth));
  }
  </code></pre>
  
  <p>Produces this output:</p>
  
  <pre><code>-----------------
   depth: 1
  -----------------
   depth: 2
  -----------------
   depth: 3
  Array
  (
      [name] =&gt; sean
      [dob] =&gt; 12-20
      [parents] =&gt; Array
          (
              [father] =&gt; tommy
              [mother] =&gt; darcy
          )
  
  )
  </code></pre>
  
  <p>What I would expect is a depth of 1 to show "name" and "dob", and a depth of 2 to show the parents, also.  I don't get why a depth of 1 or 2 displays nothing at all.</p>
  
  <p>Can anyone explain to me what I'm not understanding?</p>