Bug #16387 Updated: PHP loop when using reference to an object in an object (both in session)

From: Date: Tue, 02 Apr 2002 13:41:45 +0000
Subject: Bug #16387 Updated: PHP loop when using reference to an object in an object (both in session)
References: 1  Groups: php.bugs php.doc 
Request: Send a blank email to php-bugs+get-3821@lists.php.net to get a copy of this message
ID: 16387 Updated by: yohgaki@php.net Reported By: caugustin@alcyonis.fr -Status: Analyzed +Status: Open -Bug Type: Session related +Bug Type: Documentation problem -Operating System: Linux RH 7.2 +Operating System: ANY -PHP Version: 4.0.6 +PHP Version: PHP4 New Comment: I'll make this a documentation problem for now. Even if we made PHP not to crash with reference, there is no feasible way to restore reference to other variable. If anyone documented the issue, please change category back to Session Related and keep this report open. PHP should warn if user uses reference in session vars. Previous Comments: ------------------------------------------------------------------------ [2002-04-02 05:47:41] yohgaki@php.net It's known issue. Reference does not work well with session variable... ------------------------------------------------------------------------ [2002-04-02 05:29:01] caugustin@alcyonis.fr Hello, I don't know if it is really a bug, but it display nothing in error log and it is very anoying. I create an object 'order' and an object 'customer'. The order object has a customer object inside. To avoid duplicate in session I tried the following code when the customer login and have already started to order: $current_order->customer = &$current_customer; After this, PHP display the current page well, but any next page fail to display. Nothing apear in error_log. On a personal log system I can see that PHP is starting to loop on the page juste after the session is initialized and when the line session_register('current_customer'); is called. PHP hang after about 20 loops. After reading in detail the way session are working, I understand better that my code is a little bit dangerous (use reference in session), but PHP should return an error or display anything when it face this king of code and not enter in an invisible loop. Cedric. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16387&edit=1

« previous php.bugs (#3821) next »