From:             stochnagara at hotmail dot com
Operating system: windows xp
PHP version:      5CVS-2005-09-02 (snap)
PHP Bug Type:     Feature/Change Request
Bug description:  Extend ArrayObject::setFlags functionality

Description:
------------
ArrayObject has a method called setFlags. This method is still not
documented (set bug #34101). Anyway, I found out what is its possible
purpose - if the passed parameter is an even number then ArrayObject's
internal array values are printed in var_dump and if the passed parameter
is an odd number then object properties of the class which extends
ArrayObject are show. (See also bug #33799).

But I suggest setFlags fills another gap: set possible values to be 0, 1
or 2. 0 and 1 keep old functionality and 2 allows var_dump to print both
internal array values and properties of the class.

Reproduce code:
---------------
<?
class dummy extends ArrayObject {
        public $var;
        function __construct() {
                $this->var = 'override';
                $this['internal'] = 'base';
        }
}

$foo = new dummy();
for ($i = 0; $i < 3; $i++) {
        $foo->setFlags ($i);
        var_dump($foo);
}


Expected result:
----------------
object(dummy)#1 (1) {
  ["internal"]=>
  string(4) "base"
}
object(dummy)#1 (1) {
  ["var"]=>
  string(8) "override"
}
object(dummy)#1 (2) {
  ["internal"]=>
  string(4) "base",
  ["var"]=>
  string(8) "override"
}


Actual result:
--------------
object(dummy)#1 (1) {
  ["internal"]=>
  string(4) "base"
}
object(dummy)#1 (1) {
  ["var"]=>
  string(8) "override"
}
object(dummy)#1 (1) {
  ["internal"]=>
  string(4) "base"
}


-- 
Edit bug report at http://bugs.php.net/?id=34345&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34345&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34345&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34345&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34345&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34345&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34345&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34345&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34345&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34345&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34345&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34345&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34345&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34345&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34345&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34345&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34345&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34345&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34345&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34345&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34345&r=mysqlcfg

Reply via email to