hi,
currently, soley for backwards compatibility purposes we provide the ze2.implicit_clone option. this option is globally settable, and may be used by shared hosting providers to make it more likely that old scripts can run unmodified. this however makes it extremely hard, and inelegant for people relying on new "functionality" in php5 to write portable php5 scripts. more specifically, it would require every portable script to do:
ini_set('ze2.implicit_clone', 0);
at the top of their script.
i think we should remove this ini option in favor of a function that does the same thing. this way implicit_clone() is not globally settable, but is settable per script. something in the way of a:
pragma_set('implicit_clone', true);
which would turn on implicit_clone for the current script (current portion of code.)
A few notes:
First, either way we don't need a new function - if we wanted to do it, we could simply prevent users from using it except for with ini_set() (tag it with ZEND_INI_USER only).
Second, I think that the advantages and disadvantages here are about the same, without there being a perfect solution. If we don't allow people to set it globally, upgrading becomes much more annoying. On the other hand, if we do - new PHP 5 scripts will have to explicitly turn this compatibility mode off if they want to be absolutely certain that it's not there. My personal opinion leans towards allowing people to set it on a global scale, so that it makes upgrading much simpler - I wouldn't want to force people to start hacking all of their files before they can even test whether PHP 5 works for them.
Maybe we can go for a compromise - enable it with ZEND_INI_PERDIR and ZEND_INI_UUSE. That way it will be possible to use it with httpd.conf / .htaccess / ini_set(), but not with php.ini, so people will at least have to make a slightly more informed decision to enable it. Just a suggestion, I'm not sure I like it myself :)
Zeev
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php