title: What is the purpose of using depth in JSON encode?
body: <p>I have this <strong>example</strong> code:</p>
  
  <pre><code>$array = array(
  
      'GiamPy' =&gt; array(
              'Age' =&gt; '18',      
              'Password' =&gt; array(
                      'password' =&gt; '1234',
                      'salt' =&gt; 'abcd',
                      'hash' =&gt; 'whirlpool'
              ),  
          'Something' =&gt; 'Else'
      )
  
  );
  
  echo json_encode($array, JSON_PRETTY_PRINT);
  </code></pre>
  
  <p>I have seen in the PHP documentation that, since PHP 5.5.0 (thus recently), <code>json_encode</code> allows a new parameter which is the <strong>depth</strong>.</p>
  
  <ol>
  <li>What is its purpose?</li>
  <li>Why would I ever need it?</li>
  <li>Why has it been added in PHP 5.5.0?</li>
  </ol>