title: Weird PHP json_encode error: json_encode() expects at most 2 parameters, 3 given
body: <p>This code:</p>
  
  <pre><code>$arr = array(
      'a' =&gt; 1,
      'b' =&gt; array(
          'c' =&gt; 'Hello',
          'd' =&gt; [1, 10, 100, 1001]
      ),
  );
  
  echo json_encode($arr, JSON_PRETTY_PRINT, 2);
  </code></pre>
  
  <p>Generates this error:</p>
  
  <blockquote>
    <p>json_encode() expects at most 2 parameters, 3 given</p>
  </blockquote>
  
  <p>However the last time I checked, <a href="http://php.net/manual/en/function.json-encode.php" rel="nofollow noreferrer">json_encode</a> does accept a 3rd argument.</p>
  
  <p>I want to expand the JSON string by less depths. Ain't the 3rd the solution here? But why does it give this error while PHP doc says it accepts 3?</p>
  
  <p>FYI I'm on WAMP with PHP 5.4.</p>