Hi guys,
Now that we're at a very advanced stage and the code freeze is coming up, I
think it'd be a good idea to start running some PHP 4 applications on PHP 5
and see how easy things go. I'm sure we'll bump into some issues and many
of them might be solvable (using the already existing compatibility mode
for object cloning or by other means).
If anyone here has time or has already tried running some popular PHP
packages such as php-nuke, phpbb, phpmyadmin and so on, I'd love to hear
about your experience and especially the problems.
Thanks,
Andi
Hi Andi, I try phpmyadmin with php 5.0.0beta1 under Red Hat 9 and works
perfect.
----- Original Message -----
From: "Andi Gutmans" andi@zend.com
To: internals@lists.php.net; php-qa@lists.php.net
Sent: Wednesday, November 26, 2003 4:32 PM
Subject: [PHP-DEV] Compatibility problems with PHP 5
Hi guys,
Now that we're at a very advanced stage and the code freeze is coming up,
I
think it'd be a good idea to start running some PHP 4 applications on PHP
5
and see how easy things go. I'm sure we'll bump into some issues and many
of them might be solvable (using the already existing compatibility mode
for object cloning or by other means).If anyone here has time or has already tried running some popular PHP
packages such as php-nuke, phpbb, phpmyadmin and so on, I'd love to hear
about your experience and especially the problems.Thanks,
Andi
Hello Ivan,
same for me with a two weeks old 5b2-dev. It also runs other applications
and only one had to be patched (i didn't knew it was running n the server).
Thursday, November 27, 2003, 10:51:34 AM, you wrote:
Hi Andi, I try phpmyadmin with php 5.0.0beta1 under Red Hat 9 and works
perfect.
----- Original Message -----
From: "Andi Gutmans" andi@zend.com
To: internals@lists.php.net; php-qa@lists.php.net
Sent: Wednesday, November 26, 2003 4:32 PM
Subject: [PHP-DEV] Compatibility problems with PHP 5
Hi guys,
Now that we're at a very advanced stage and the code freeze is coming up,
I
think it'd be a good idea to start running some PHP 4 applications on PHP
5
and see how easy things go. I'm sure we'll bump into some issues and many
of them might be solvable (using the already existing compatibility mode
for object cloning or by other means).If anyone here has time or has already tried running some popular PHP
packages such as php-nuke, phpbb, phpmyadmin and so on, I'd love to hear
about your experience and especially the problems.Thanks,
Andi--
--
Best regards,
Marcus mailto:helly@php.net
Andi Gutmans wrote:
issues and many of them might be solvable (using the already existing
compatibility mode for object cloning or by other means).
Could we please, please, please have a way of cloning objects which
works in both versions? I'd like to use the new semantics as soon as
it's available (no compatibility mode) but still be able to run my
application on PHP4.
See my posting about the need for a clone() function. I didn't get an
answer there so I wonder how everyone else is dealing with this issue.
- Chris
If anyone here has time or has already tried running some popular PHP
packages such as php-nuke, phpbb, phpmyadmin and so on, I'd love to hear
about your experience and especially the problems.
make install segfaults at the moment, see the mail I posted yesterday.
Testing stuff is quite hard now...
Derick
Great to hear that!
At 10:51 AM 11/27/2003 +0100, Ivan Rodriguez wrote:
Hi Andi, I try phpmyadmin with php 5.0.0beta1 under Red Hat 9 and works
perfect.----- Original Message -----
From: "Andi Gutmans" andi@zend.com
To: internals@lists.php.net; php-qa@lists.php.net
Sent: Wednesday, November 26, 2003 4:32 PM
Subject: [PHP-DEV] Compatibility problems with PHP 5Hi guys,
Now that we're at a very advanced stage and the code freeze is coming up,
I
think it'd be a good idea to start running some PHP 4 applications on PHP
5
and see how easy things go. I'm sure we'll bump into some issues and many
of them might be solvable (using the already existing compatibility mode
for object cloning or by other means).If anyone here has time or has already tried running some popular PHP
packages such as php-nuke, phpbb, phpmyadmin and so on, I'd love to hear
about your experience and especially the problems.Thanks,
Andi
At 11:00 AM 11/27/2003 +0100, Christian Schneider wrote:
Andi Gutmans wrote:
issues and many of them might be solvable (using the already existing
compatibility mode for object cloning or by other means).Could we please, please, please have a way of cloning objects which works
in both versions? I'd like to use the new semantics as soon as it's
available (no compatibility mode) but still be able to run my application
on PHP4.See my posting about the need for a clone() function. I didn't get an
answer there so I wonder how everyone else is dealing with this issue.
You can use the zend2.implicit_clone INI directive (change it at run-time
if you want at the beginning of the application).
Andi
Andi Gutmans wrote:
You can use the zend2.implicit_clone INI directive (change it at
run-time if you want at the beginning of the application).
But I do want to move my application to the new semantics, I think it is
much more reasonable than the PHP4 behaviour anyway (sadly enough my
request to ref instead of copy on assignment was turned down in the PHP4
alpha days ;-)).
I simply want to have a way of doing an explicit clone where it is
really needed. I still can't see no reason why there should be no
migration path for this. PHP5 adoption is going to be hard enough due to
subtle bugs arising from this so I think clone() is the least we could
do here. Forcing people to use zend2.implicit_clone won't help this IMHO.
- Chris
Hello Christian,
Thursday, November 27, 2003, 11:51:06 AM, you wrote:
Andi Gutmans wrote:
You can use the zend2.implicit_clone INI directive (change it at
run-time if you want at the beginning of the application).
But I do want to move my application to the new semantics, I think it is
much more reasonable than the PHP4 behaviour anyway (sadly enough my
request to ref instead of copy on assignment was turned down in the PHP4
alpha days ;-)).
I simply want to have a way of doing an explicit clone where it is
really needed. I still can't see no reason why there should be no
migration path for this. PHP5 adoption is going to be hard enough due to
subtle bugs arising from this so I think clone() is the least we could
do here. Forcing people to use zend2.implicit_clone won't help this IMHO.
If i get you right you want to have __clone() for PHP4, too right? But
that's already to late. And using it on PHP5 to emulate PHP4 behavior where
needed might not solve all problems, so what can we do besides __clone and
the ini directive?
--
Best regards,
Marcus mailto:helly@php.net
Marcus Boerger wrote:
If i get you right you want to have __clone() for PHP4, too right? But
that's already to late.
That's what I was told when I was asking for ref on assignment for PHP4.
And now we have to go through this hassle for PHP5. I simply cannot
believe noone thought of this problem when it was still possible to add
it to PHP4 and we stick to this just for the sake of a feature freeze.
The function is so trivial (and IMHO so important) that being strict
here seems plain wrong to me. After all it hinders migration to PHP5!
- Chris
Marcus Boerger wrote:
If i get you right you want to have __clone() for PHP4, too right? But
that's already to late.That's what I was told when I was asking for ref on assignment for PHP4.
And now we have to go through this hassle for PHP5. I simply cannot
believe noone thought of this problem when it was still possible to add
it to PHP4 and we stick to this just for the sake of a feature freeze.
The function is so trivial (and IMHO so important) that being strict
here seems plain wrong to me. After all it hinders migration to PHP5!
Just use an auto_prepend which sets the implicit_clone option... no
problems then anymore.
Derick
Derick Rethans wrote:
Just use an auto_prepend which sets the implicit_clone option... no
problems then anymore.
Sigh
Looks like you're not reading my postings really.
This means your migration path to ref on assignement semantics is:
- current code, copy (PHP4)
- wait months for PHP5 to be ready for production, twidddling thumbs
- current code, copy (Switch to PHP5 with implicit clone)
- atomic rewrite, ref (PHP5, incompatible with PHP4)
So I can't start to migrate my code to PHP5 yet or I have to branch my
code at 2) just for this which I won't do as it could be a couple of
months until we decide it is ready for production machines. And I can't
switch back to PHP4 if I run into other problems.
But ok, seems like I'm the only one bothered by this.
- Chris
Hey Christian,
Why not add your own clone() function to your apps;
something like this:
if (version_compare(phpversion(), "5.0", "<")) {
function clone($object) { return $object; }
} else {
function clone($object) { return $object->__clone(); }
}
then (re)write all your code to call clone() where
you need it.
[I know that this is what you want to have in php 4
and php 5 right now anyway; but its only a couple
of lines of code to add to your project]
--Wez.
Wez Furlong wrote:
Why not add your own clone() function to your apps;
If you read my original posting you'll notice that I've already done
this but I thought other people have exactly the same problem.
Looks like I was wrong.
- Chris
Zitat von Andi Gutmans andi@zend.com:
Hi guys,
Now that we're at a very advanced stage and the code freeze is coming up,
I
think it'd be a good idea to start running some PHP 4 applications on PHP
5
and see how easy things go. I'm sure we'll bump into some issues and many
of them might be solvable (using the already existing compatibility mode
for object cloning or by other means).If anyone here has time or has already tried running some popular PHP
packages such as php-nuke, phpbb, phpmyadmin and so on, I'd love to hear
about your experience and especially the problems.
Horde et al suffered from new reserved words, the known
return-non-variables-by-reference-problem, the changed array_merge()
behaviour/notification and not working on-the-fly-generation of stdClass
objects. It's not that much of a problem for us as we will release new
major versions near to the PHP 5 release, that will be tested with PHP
HEAD.
Jan.
--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft
[snip]
behaviour/notification and not working on-the-fly-generation of stdClass
objects. It's not that much of a problem for us as we will release new
What exactly is the problem with stdClass? We have a lot of code overhere that
rely on stdClass behaiving as it did in php4.
Edin
[snip]
behaviour/notification and not working on-the-fly-generation of stdClass
objects. It's not that much of a problem for us as we will release newWhat exactly is the problem with stdClass? We have a lot of code overhere that
rely on stdClass behaiving as it did in php4.
By doing this:
<?php
$tpl->foo = 'blaat';
?>
in PHP 4 you would get a object of stdClass, in PHP 5 you get a warning.
Derick
Andi, any chance of fixing this? I think there was a long thread on engine2
about this and there was an agreement that this should work as in php4.
Edin
[snip]
behaviour/notification and not working on-the-fly-generation of
stdClass objects. It's not that much of a problem for us as we will
release newWhat exactly is the problem with stdClass? We have a lot of code overhere
that rely on stdClass behaiving as it did in php4.By doing this:
<?php
$tpl->foo = 'blaat';
?>in PHP 4 you would get a object of stdClass, in PHP 5 you get a warning.
Derick
Zitat von Edin Kadribasic edink@emini.dk:
[snip]
behaviour/notification and not working on-the-fly-generation of
stdClass
objects. It's not that much of a problem for us as we will release newWhat exactly is the problem with stdClass? We have a lot of code overhere
that
rely on stdClass behaiving as it did in php4.
Actually I'm not sure if this problem still exists, but I found that
checking our commits related to ZE2 fixes.
Creating objects on the fly didn't work or at least raised a warning/error.
I changed code like:
$not_existing_object->foo = "bar";
to:
$not_existing_object = new stdClass();
$not_existing_object->foo = "bar";
Jan.
--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft
Hey,
Now that we're at a very advanced stage and the code freeze is coming up, I
think it'd be a good idea to start running some PHP 4 applications on PHP 5
and see how easy things go. I'm sure we'll bump into some issues and many
of them might be solvable (using the already existing compatibility mode
for object cloning or by other means).
There is one major problem that I see at this moment, and that is the
problem with shutdown order and destructors.
Problem 1:
extension=mysql.so
<?php
class foo {
private $c;
function __construct() {
$this->c = mysql_connect();
}
function __destruct() {
mysql_close($this->c);
}
}
$f = new foo();
?>
This little script will give you a nice unresolved symbol when doing the
mysql_close as the extensions are unloaded before the dtors run.
Problem 2:
The following script:
<?php
class A {
public function __destruct() {
echo "destructor!\n";
}
}
$obj = new A();
echo "I'm alive!\n";
?>
crashes Xdebug. While I thought it was my bug, it turned out to have
the same cause as problem 1: the dtor is run after the GET/POST/COOKIE
var tables are destroyed. (Xdebug tries to check some things in there on
every function call). It's not only this, see problem 3.
788 zend_hash_find(PG(http_globals)[TRACK_VARS_GET]->value.ht, "XDEBUG_SESSION_START", sizeof("XDEBUG_SESSION_START"), (void **) &dummy) == SUCCESS
(gdb) bt
#0 0x0826325d in _zend_is_inconsistent (ht=0x5a5a5a5a,
file=0x8417660 "/dat/dev/php/php-5.0dev/Zend/zend_hash.c", line=841)
at /dat/dev/php/php-5.0dev/Zend/zend_hash.c:53
#1 0x082656f1 in zend_hash_find (ht=0x5a5a5a5a,
arKey=0x406446bd "XDEBUG_SESSION_START", nKeyLength=21, pData=0xbfffe70c)
at /dat/dev/php/php-5.0dev/Zend/zend_hash.c:841
#2 0x406325dd in xdebug_execute (op_array=0x405f9000)
at /dat/dev/php/xdebug/xdebug.c:788
#3 0x08252cd3 in zend_call_function (fci=0xbfffec20, fci_cache=0x0)
at /dat/dev/php/php-5.0dev/Zend/zend_execute_API.c:737
(gdb) frame 3
#3 0x08252cd3 in zend_call_function (fci=0xbfffec20, fci_cache=0x0)
at /dat/dev/php/php-5.0dev/Zend/zend_execute_API.c:737
737 zend_execute(EG(active_op_array) TSRMLS_CC);
(gdb) print *executor_globals.active_op_array
$2 = {type = 2 '\002', function_name = 0x405f5608 "__destruct",
scope = 0x405f7518, fn_flags = 16640, prototype = 0x0, num_args = 0,
arg_info = 0x0, pass_rest_by_reference = 0 '\0', refcount = 0x405f792c,
opcodes = 0x405f7968, last = 5, size = 5, T = 0, brk_cont_array = 0x0,
last_brk_cont = 0, current_brk_cont = 4294967295, static_variables = 0x0,
start_op = 0x0, backpatch_count = 0, return_reference = 0 '\0',
done_pass_two = 1 '\001', uses_this = 0 '\0',
filename = 0x405f5d8c "/dat/dev/php/xdebug/tests/bug00001.php",
line_start = 3, line_end = 5, doc_comment = 0x0, doc_comment_len = 0,
reserved = {0x0, 0x1, 0x8414a60, 0x923}}
Problem 3:
All extension globals are also destroyed before destructors run:
0x40631ac0 in add_stack_frame (zdata=0xbfffeb80, op_array=0x405f9000, type=0)
at /dat/dev/php/xdebug/xdebug.c:684
684 xdebug_llist_insert_next(XG(stack), XDEBUG_LLIST_TAIL(XG(stack)), tmp);
(gdb) bt
#0 0x40631ac0 in add_stack_frame (zdata=0xbfffeb80,
op_array=0x405f9000,
type=0) at /dat/dev/php/xdebug/xdebug.c:684
#1 0x40632040 in xdebug_execute (op_array=0x405f9000)
at /dat/dev/php/xdebug/xdebug.c:830
#2 0x08252cd3 in zend_call_function (fci=0xbfffec20, fci_cache=0x0)
at /dat/dev/php/php-5.0dev/Zend/zend_execute_API.c:737
(gdb) print xdebug_globals.stack
$2 = (xdebug_llist *) 0x0
(this variable is initialized in MINIT and destroyed in MSHUTDOWN).
Parts of a chat with Zeev about this:
12:11 <@Derick> the hook you added "exec_finished" didn't solve my problem
12:11 <@Derick> because destructors are still called AFTER RSHUTDOWN :(
12:11 <@Zeev> they're not supposed to
12:11 <@Zeev> but I didnt do anything beyond exec_finished
12:11 <@Zeev> that is, nothing uses it yet
12:11 <@Derick> so what's the point of it ? :)
12:11 <@Zeev> the point is that it solves the problem
12:11 <@Zeev> once things start using it :)
12:12 <@Zeev> I can barely type
12:12 <@Zeev> my fingers are on fire
12:12 <@Derick> well, then the ZE needs to be modified to use it ;)
12:12 <@Derick> Zeev: peppers?
12:12 <@Zeev> derick the engine isnt supposed to use it
12:12 <@Derick> heh
12:12 <@Zeev> it simply has to call destructors after exec_finished
12:12 <@Zeev> but before rshutdown
12:12 <@Derick> yes
12:13 <@Zeev> but we cant do that before modules like the session module implement exec_finished
12:13 <@Derick> doesn't that need an engine mod then?
12:13 <@Derick> Zeev: ah ha
12:13 <@Zeev> because they're the reason destructors are called after rshutdown to begin with
12:13 <@Zeev> and yeah
12:13 <@Derick> Zeev: the problem is that if you mod session, the stuff needs to work first ... it's a chicken and egg problemm
Related test case:
14:46 <@Derick> ZE2 accessing globals from destructor in shutdown [tests/classes/destructor_and_globals.phpt]
14:46 <@Derick> Andi_: thats the one I told you about a couple of days ago btw
regards,
Derick
Hello Derick,
Thursday, November 27, 2003, 11:54:07 AM, you wrote:
Hey,
Now that we're at a very advanced stage and the code freeze is coming up, I
think it'd be a good idea to start running some PHP 4 applications on PHP 5
and see how easy things go. I'm sure we'll bump into some issues and many
of them might be solvable (using the already existing compatibility mode
for object cloning or by other means).
There is one major problem that I see at this moment, and that is the
problem with shutdown order and destructors.
Problem 1:
extension=mysql.so
[...]
Since about three month i have a patch to fix this. The latest update can be
found here: http://marcus-boerger.de/php/ext/ze2/ze2-shutdown-20031002.diff.txt
Tell me if it doesn't apply then i'll update it.
What it basically does is destructing the zval's in correct order. The old
algorythm had a magnitude of O(n) while the new one has a magnitude of
O(nlog(n)) while it should have a normal runtime of N(n) in most cases too.
Maybe it is a little bit slower so that runtime could be written as N(nc)
with 1 < c < 1.1. Since we never cared about shutdown time this should be ok
anyways. Also the inner loop breaks at a mximum of 64 where its minimum
depends on the outer loop. That means that in worst case scenarios that the
algorythmn can't solve a few variables take more time then the rest but at
least they are freed anyway.
--
Best regards,
Marcus mailto:helly@php.net
Hi Andi,
If anyone here has time or has already tried running some popular PHP
packages such as php-nuke, phpbb, phpmyadmin and so on, I'd love to
hear about your experience and especially the problems.
I forwarded this to pear-dev. I know that some people are already
playing with 5 there, so they could share their results.
Jan
Q: Thank Jan? - A: http://geschenke.an.dasmoped.net/
"We cats are very independent. We need nobody, no time,
no where, no way. Isn't that right Pooky?" - Garfield
Key Fingerprint 7BCC EB86 8313 DDA9 25DF 1805 ECA5 BCB7 BB96 56B0
Hello,
Hi guys,
Now that we're at a very advanced stage and the code freeze is coming up, I
think it'd be a good idea to start running some PHP 4 applications on PHP 5
and see how easy things go. I'm sure we'll bump into some issues and many
of them might be solvable (using the already existing compatibility mode
for object cloning or by other means).If anyone here has time or has already tried running some popular PHP
packages such as php-nuke, phpbb, phpmyadmin and so on, I'd love to hear
about your experience and especially the problems.
Version 2.6.0 (the latest) of the Smarty template engine seems to go
fine with php5. There is one new and rarely used feature in this
version that relies on passing a function-parameter that has to be
named "$this". But I'm sure this will be fixed in the near future.
Older versions of Smarty create code that calls functions dynamically
"$this->_plugins['function']['foo'][0](array(), $this)". This seems to
break in php-5.
greetings
messju
Thanks,
Andi
function table creation works fine, but as it doesn't use any
OO stuff at all it is not that astonishing ... ;)
--
Hartmut Holzgraefe <hartmut@php.net
Andi Gutmans wrote:
If anyone here has time or has already tried running some popular PHP
packages such as php-nuke, phpbb, phpmyadmin and so on, I'd love to
hear about your experience and especially the problems.
Dunno if these are popular, but phpOpenTracker and XML_Transformer work
fine.
I had to change
function &get($parameters) {
include_once POT_INCLUDE_PATH . 'API.php';
$api = &phpOpenTracker_API::getInstance();
return $api->get($parameters);
}
to
function &get($parameters) {
include_once POT_INCLUDE_PATH . 'API.php';
$api = &phpOpenTracker_API::getInstance();
$result = $api->get($parameters);
return $result;
}
but I think that this is a known problem.
--
Sebastian Bergmann
http://sebastian-bergmann.de/ http://phpOpenTracker.de/
Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/