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

From: Date: Sat, 27 Dec 2003 04:48:52 +0000
Subject: #26724 [Fbk->Opn]: get_class() and __CLASS__ causing crashes and erratic behaviour
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-52514@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: Feedback +Status: Open Bug Type: Class/Object related Operating System: Windows XP PHP Version: 5CVS-2003-12-26 (dev) New Comment: 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 ) Previous Comments: ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ [2003-12-26 22:34:17] thought at phenomind dot com Description: ------------ Apologise for not being able to describe this better or give example code. get_class() and __CLASS__ cause PHP5 to behave erratically. Sometimes changes the data within the [argument] object and often causes Apache to crash. Problems experienced on Windows XP. Same problem also caused a Dual Processor Mac OS-X box to soak up CPU time 1 processor. Script calls get_class() many, many times or complex, composite objects. The erratic behaviour is very hard to pin down but the source is definitely get_class(). PHP5 objects are not very happy with this function. Reproduce code: --------------- I can say: print_r($object); print get_class($object); print_r($object); Expected result: ---------------- 1) object dump 2) Name of object 3) same object dump Actual result: -------------- 1) object dump 2) Name of object 3) object dump with probably one property changed No other code in the middle to cause this behaviour. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26724&edit=1

« previous php.bugs (#52514) next »