#26724 [Opn->Csd]: get_class() and __CLASS__ causing crashes and erratic behaviour

From: Date: Tue, 30 Dec 2003 03:48:56 +0000
Subject: #26724 [Opn->Csd]: get_class() and __CLASS__ causing crashes and erratic behaviour
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-52596@lists.php.net to get a copy of this message
ID: 26724 User updated by: thought at phenomind dot com Reported By: thought at phenomind dot com -Status: Open +Status: Closed Bug Type: Class/Object related Operating System: Windows XP PHP Version: 5CVS-2003-12-26 (dev) New Comment: I will close this bug until I can get more specific, reproducable results. Previous Comments: ------------------------------------------------------------------------ [2003-12-29 22:37:09] thought at phenomind dot com Apologies. I meant two-element array. Not two-dimensional! ------------------------------------------------------------------------ [2003-12-29 22:36:02] thought at phenomind dot com Okay. I think I may have some snippets of code to demonstrate this: I have defined a two dimensional array like this: $this->composite_object_names[0] = "piece"; $this->composite_object_names[1] = "pod_log"; Yet when I do a print_r on the object, I am getting this: [composite_object_names:public] => Array ( [0] => Diece [1] => Dod_log ) I have numerous instances of get_class() and __CLASS__ scattered throughout my code. I know that if I remove this, the object will be fine. I am also suspicious of the get_object_vars() function but that it is almost impossible for me to quantify which one of these functions is at the root of the problem. There is a bug here ------------------------------------------------------------------------ [2003-12-26 23:48:51] thought at phenomind dot com Sorry, I cannot but I just removed 500+ instances of get_class() and __CLASS__ from many libraries of code and the problem has disappeared. I'll give you an example of the object where the primary_key property was corrupted. It is fine in this instance because I have already done the abovementioned alterations: user_session Object ( [y_resolution] => [x_resolution] => [flash_version] => [session_identifier] => [timestamp_difference] => [cookies_enabled] => [ip_address] => [browser] => [nominated_transport_agent_key] => [nominated_shipper_key] => [nominated_project_key] => [live_key] => 73 [new_on_load] => [table_name] => user_sessions [composite_object_name] => [composite_key] => [primary_key] => user_session_key [database] => mysql_db Object ( [engine] => mysql [username] => **** [password] => ********* [service_name] => [live_table] => [commit_query] => 0 [tns_admin] => [vars] => vars Object ( [username] => ****** [btn_login] => Login [password] => **** [encoded_php_self] => ) [database_name] => BKCARGO [host] => localhost [port] => 3306 [host_port] => localhost:3306 [database_handle] => Resource id #80 [query] => UPDATE user_sessions SET user_key = '1', transport_agent_key = '', shipper_key = '', project_key = '', y_resolution = '', x_resolution = '', flash_version = '', session_identifier = '', timestamp_difference = '', cookies_enabled = '', ip_address = '', browser = '', live_user_key = '1' WHERE user_session_key='73' [result_handle] => 1 ) [vars] => vars Object ( [username] => ******** [btn_login] => Login [password] => ******* [encoded_php_self] => ***** ) [user_key] => 1 [user_session_key] => 73 [live_user_key] => 1 ) ------------------------------------------------------------------------ [2003-12-26 23:41:25] gschlossnagle@php.net Can you post an example that actually reproduces? A simple class used with your code runs fine on OS X. ------------------------------------------------------------------------ [2003-12-26 23:08:41] thought at phenomind dot com Problems also with get_object_vars() If my script has this function anywhere, PHP5 produces erratic results. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/26724 -- Edit this bug report at http://bugs.php.net/?id=26724&edit=1

« previous php.bugs (#52596) next »