Hi Rob,

I understand the problem although I haven't analyzed it in as much depth as you have as to when exactly it happens.
The thing is that I see compatibility_mode as something which is supposed to help make most old scripts run with PHP 5. I think scripts that take advantage of new PHP 5 features such as SimpleXML and friends should be required to not run in compatibility_mode.
No I know DOM existed in PHP 4, but it has changed and I think it's fair to require that if a person ports their application to PHP 5 DOM then they port the whole thing.
You know I'm probably one of the strongest BC advocated on this list but I think it's best not to change this.
Do you understand where I'm coming from?
Thanks,
Andi


At 09:07 PM 8/26/2004 -0400, Rob Richards wrote:
The issue is that with some of the new extensions, the object "breaks" when
compatibility mode is enabled making the extensions useless. The patch was
basically an attempt to allow a way for the extensions to be able to run
under compatibility mode.
Take for example a simple case (NULL is returned with var_dump under compat
mode):
<?php
$dom = new DomDocument();
$dom->loadXML("<root> hello </root>");
$element = $dom->documentElement;
var_dump($element->parentNode);
?>

This is due to the clone functionality, which is correct when someone does
"clone $obj". Either there should be a way to allow extensions to be written
to support compat mode and clone (providing different functionality), compat
mode should be able to be disabled in an extension while clone syntax
supported, or a decision should be made that in cases where the two cant
have the same functionality that clone just shouldnt be supported.

Im not sure about other new extensions running into this, but simplexml is
another I played around with that runs into the same thing.

Rob

From: Andi Gutmans


> What is the issue? In general, as it's compatibility mode it's not supposed > to solve 100% but only 99.5% of the problems, and I don't really want to > change the engine's general API unless it's for a good reason. > Actually I have not seen many applications that have been broken due to the > removal of auto-cloning in PHP 5. > I think that as porting is required to use the new DOM/XSL extensions > anyway, they should also port their OO code. The idea was that old > untouched code would run, but if you want to take advantage of new features > you're best to port all the way.

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



Reply via email to