From:             gfraley5 at earthlink dot net
Operating system: All
PHP version:      4.3.2
PHP Bug Type:     Feature/Change Request
Bug description:  Need capability to deregister/overload functions

If this capability already exists I can't find it.  Is it planned/possible
to allow functions to be deregistered so that they can be replaced,
basically overloading them?  In other words, right now, if function a() is
defined/registered, I am not able to replace it conditionally, I imagine
since the compiler has already compiled the script prior to processing it.
 I am seeking the ability to conditionally call scripts where the
different scripts have the same function names that the calling script
has.  In other words, the scenario is this.

Script Master.php might look like this:

<?
If (condition) {
    include('override_script.php');
    exit();
}

function sameNameAsInOverride_script() {
//do stuff
}
?>

Possibly have it do this:
<?
If (condition) {
    function_deregister(sameNameAsInOverride_script);
    include('override_script.php');
    exit();
}

function sameNameAsInOverride_script() {
//do stuff
}
?>

Possible?
-- 
Edit bug report at http://bugs.php.net/?id=23987&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=23987&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=23987&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=23987&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=23987&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=23987&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=23987&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=23987&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=23987&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=23987&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=23987&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23987&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=23987&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=23987&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=23987&r=gnused

Reply via email to