I would like to override, let's say mysql_num_rows
with let's say following:
$dataset = array(array('id' => 1, 'name' => 'Zlatan', 'onSOF' => 1), array('id' => 1, 'name' => 'Guest', 'onSOF' => 0));
function mysql_num_rows($dataset) {
return sizeof($dataset);
}
Does PHP support built-in function overriding?
EXTENDING
I want to create an OpenSource solution which will override all existing mysql_*
functions, and it their function body I'll be using PDO instances and methods, and properties.
This means that users who already use the mysql_*
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.