title: Difference between "function($arg = 0)" and "function($arg)"
body: <h1>Question</h1>
  
  <p>In the PHP Official Documentation I found somewhere declarations like this:</p>
  
  <pre><code>public int save ( string $filename [, int $options ] )
  </code></pre>
  
  <p>and like this:</p>
  
  <pre><code>public mixed load ( string $filename [, int $options = 0 ] )
  </code></pre>
  
  <h3>What's the difference between both, on the <code>$options</code> argument?</h3>
  
  <p>The second one I'm sure that has the <code>$options</code> argument set to <em>0</em> (when I don't specify it).
  But the first one? Isn't it saying that the method has 2 mandatory arguments? (so whats the square brackets for?).</p>
  
  <h1>Example</h1>
  
  <p>I'm trying to override this:</p>
  
  <pre><code>public bool schemaValidate ( string $filename [, int $flags ] )
  </code></pre>
  
  <p><em>(fingerprint pasted from <a href="http://php.net/manual/en/domdocument.schemavalidate.php" rel="nofollow">schemaValidate() PHP documentation</a>)</em></p>
  
  <p>but if I declare the second argument <code>$flags</code>, then I get a </p>
  
  <blockquote>
    <p>SchemaValidate() should be compatible with DOMDocument::schemaValidate($filename)</p>
  </blockquote>
  
  <p>If I remove the declaration of <code>$flags</code> everything works (like if I were in <strong>&lt;</strong> <em>PHP 5.5.2</em>)</p>
  
  <p>While I run <em>PHP 5.5.9</em> and <code>$flags</code> has been introduced in <code>schemaValidate()</code> constructor from <em>PHP 5.5.2</em>, why do I get the incompatibly problem?</p>
  
  <p>I don't get <strong>if the PHP Documentation is trustable or if I should check somewhere else</strong> for the right function fingerprint, when I want to override native methods.</p>
  
  <p>I tried to have a look at the source code, but <a href="https://github.com/php/php-src/blob/fc33f52d8c25997dd0711de3e07d0dc260a18c11/ext/dom/document.c#L228" rel="nofollow">the function is merely an alias to a <em>C</em> function</a>.</p>