Like that one, ridiculous:

static private function getStruct(&$class) {
        if(!(is_array(Entity::$struct) && array_key_exists($class,
Entity::$struct))) {
        eval("if(!isset(".$class."::\$structure))
self::array2xml('".$class."');");
        eval("Entity::\$struct[\$class] = new SimpleXMLElement(
".$class."::\$structure);");
}
return Entity::$struct[$class];
}

Do you understand what it does? Do you find it readable? Clean? I don't.
Yet that's what I have to write in PHP.

What you were trying to do I wonder?

Maybe the problem arises in PHP because, as far as I know, there is no way
to define a function as virtual, like in C++, and so you can't choose
between static lookup or dynamic lookup.

In C++, as far as I know, there's no such thing as static virtual function.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

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

Reply via email to