ID: 21604 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Wont fix Bug Type: Zend Engine 2 problem Operating System: Windows 2000 Server PHP Version: 4.2.3 New Comment:
Yup, this is a feature indeed and wont be fixed because of BC reasons. Previous Comments: ------------------------------------------------------------------------ [2003-01-25 08:51:57] [EMAIL PROTECTED] for ZE1 this is definetly a (documented?) feature ... i don't know about ZE2, but for backwards compatibility reasons i think this 'feature' will stay ... any authoritative comments on this? ------------------------------------------------------------------------ [2003-01-15 20:11:14] [EMAIL PROTECTED] Can someone from an authority standpoint look into this? If it is a feature, then it is potentially quite dangerous, both from a security standpoint as well as from on operational standpoint. Why bother having class variables at all if that is the case? ------------------------------------------------------------------------ [2003-01-15 11:50:06] [EMAIL PROTECTED] This is a "feature", not a bug. I can see good uses for this, my DataObject class uses this feature for dynamically adding instance variables from database records. ------------------------------------------------------------------------ [2003-01-12 22:46:08] [EMAIL PROTECTED] If you run the following script and check the output, you will see the that variable JUNK has been dynamically defined in the class X_Row() by using the statement: $user->query_row->JUNK = "stuff"; This behaviour certainly wasn't what I would expect. ----------------------- <?php class X { var $query_row; function X() { $this->query_row = new X_Row(); return; } } class X_Row { var $USERNAME; var $PASSWORD; var $CHECKING; function X_Row() { $this->USERNAME = NULL; $this->PASSWORD = NULL; $this->CHECKING = NULL; return; } //end function X_Row } //X_Row $user = new X(); //$user->query_row is of class X_Row //Therefore, the next statement should be valid, //USERNAME has been declared in X_Row $user->query_row->USERNAME = 'mtl'; //But the next statement shouldn't be //because the variable JUNK has not //been declared in the class $user->query_row->JUNK = 'stuff'; $classname = get_class($user->query_row); $classvars = get_class_vars($classname); $query_row_class_vars = array_keys($classvars); echo "classname:{$classname}<br>"; echo "classvars:<br>"; var_dump($classvars); echo "<br>query_row_class_vars<br>"; var_dump($query_row_class_vars); echo "<br><br>HOW IS THIS POSSIBLE? SEE BELOW!!!!!!!!!"; echo "<br>user->query_row:<br>"; var_dump($user->query_row); ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21604&edit=1