title: How to override built-in PHP function(s)?
body: <p>I would like to override, let's say <code>mysql_num_rows</code> with let's say following:</p>
  
  <pre><code>$dataset = array(array('id' =&gt; 1, 'name' =&gt; 'Zlatan', 'onSOF' =&gt; 1), array('id' =&gt; 1, 'name' =&gt; 'Guest', 'onSOF' =&gt; 0));
  
  function mysql_num_rows($dataset) {
      return sizeof($dataset);
  }
  </code></pre>
  
  <p>Does PHP support built-in function overriding?</p>
  
  <hr>
  
  <p><em><strong>EXTENDING</em></strong></p>
  
  <p>I want to create an OpenSource solution which will override all existing <code>mysql_*</code> functions, and it their function body I'll be using PDO instances and methods, and properties.</p>
  
  <p>This means that users who already use the <code>mysql_*</code> and find it hard to move completely to PDO, should just include this function override, and all properties, function calls, function return values, argument values, etc, should be left the same.</p>