Sam Barrow wrote:
If anyone here is experienced enough to help me, I will pay for a patch
to allow for multiple class inheritance (class D extends A, B, C)
against PHP 5.3 CVS. Or if you can just help me get started on writing
it, I'm sure I could finish myself. I'm just stuck at the basic zend
class declaration functions.

runkit could probably implement this using some composting rules... It doesn't have all the required pieces at the moment, but it's got most of 'em... If you don't care about default values or interfaces, you can probably fill in the rest using ReflectionClass....

-Sara

<?php

class Foo extends A { }
extend_class_from_additional_classes('Foo', array('B','C'));


function extend_class_from_additional_classes($destClass, Array $extra)
{
    foreach($extra as $class) {
        // Transpose methods
        foreach(get_class_methods($class) as $method) {
            if (!method_exists($destClass, $method)) {
                runkit_method_copy($destClass, $method, $class);
            }
        }

        // Transpose Properties
        // Transpose Constants
        // Transpose Interfaces
/* These bits need a couple more runkit features to make work, but only a couple... */
}

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to