1

I don't find any example of using ArrayObject with ArrayObject::STD_PROP_LIST flag. http://www.php.net/manual/en/arrayobject.setflags.php Can you give me any example of using ArrayObject with this flag?

2 Answers 2

7

Since PHP 5.3, this flag does not have any influence any longer.

http://3v4l.org/Fk3Qu

Output for 5.3.0 - 5.5.0beta2

ArrayObject Object
(
    [prop] => prop data
    [storage:ArrayObject:private] => Array
        (
            [arr] => array data
        )

)
ArrayObject Object
(
    [prop] => prop data
    [storage:ArrayObject:private] => Array
        (
            [arr] => array data
        )

)

Output for 5.1.0 - 5.2.17

ArrayObject Object
(
    [prop] => prop data
)
ArrayObject Object
(
    [arr] => array data
)

This has been also reported as a bug:

Sign up to request clarification or add additional context in comments.

Comments

-1

There's an example on this page in the ArrayObject documentation.

3 Comments

Can you please provide an example that demonstrates how using that constant makes a difference in contrast to not using that constant? Because the documentation does not give any example.
@M8R-1jmw5r Did you look at the page I linked to? There's a demonstration by MarkAndrewSlade that shows the difference.
Thanks for the heads-up, I've used his example and it seems that this does not work any longer with current PHP versions. stackoverflow.com/a/15960458/2261774

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.