#34345 [Opn->WFx]: Extend ArrayObject::setFlags functionality
| From: | helly@php.net | Date: | Fri, 02 Sep 2005 20:28:26 +0000 |
| Subject: | #34345 [Opn->WFx]: Extend ArrayObject::setFlags functionality | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-84448@lists.php.net to get a copy of this message | ||
ID: 34345
Updated by: helly@php.net
Reported By: stochnagara at hotmail dot com
-Status: Open
+Status: Wont fix
Bug Type: Feature/Change Request
Operating System: *
PHP Version: 5CVS-2005-09-02 (snap)
Assigned To: helly
New Comment:
Reading it again i must say that it is not possible to fill your gap.
Previous Comments:
------------------------------------------------------------------------
[2005-09-02 22:00:31] helly@php.net
The documentaion is updated here:
http://php.net/~helly
------------------------------------------------------------------------
[2005-09-02 13:25:09] stochnagara at hotmail dot com
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 this bug report at http://bugs.php.net/?id=34345&edit=1