Hi,
is the $this variable affectation authorized
(clean enough)?
It's works in 4.1.x, but next php versions...

class X {
        function polymorph($class){
                // Backup vars here
                $this=new $class();
                // Restore vars here
        }
}

What is the usage?
- A (MySQL) table
- A class to manage the table
- A class by record type

$x=new X();
$x->read_record(12);
switch($x->type){// Got by read_record
case 'X1':
case 'X2':
        $x->polymorph($x->type);
        break;
default:
        exit(1);
}
$x->specific_method();// From X1 or X2 class



___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en franšais !
Yahoo! Mail : http://fr.mail.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to