Ilia Alshanetsky wrote:
> Just because behavior of something had changed in php6 does not mean it
> should change in php5 as well. It is the job of new releases to be
> backwards compatible, not old releases to be forward compatible.

While I agree not to clutter PHP5 too much I can see the point in adding
some stuff here.

It would have been easier to prepare PHP4 code to the PHP5 clone
migration if a clone functionality would have been made available early
in PHP4 when it was clear what the PHP5 way of cloning would be.

Now I'm stuck with this ugly work-around if I want to be cross-version
compatible:
function &cloneobj(&$object)
{
        $result = (is_object($object) && version_compare(zend_version(), 2,
'>=')) ? clone($object) : $object;

        return $result; # PHP internals need a tmp var to return by ref
}

While I'm as of yet unsure how and how often binary strings are going to
be used I think it is worth considering opening up the migration path early.

- Chris

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

Reply via email to