mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Example uses var_dump
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@296851 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
1d2f019c2f
commit
e0ec02cef9
1 changed files with 2 additions and 3 deletions
|
@ -86,12 +86,11 @@ $fruits = array("lemons" => 1, "oranges" => 4, "bananas" => 5, "apples" => 10);
|
|||
$fruitsArrayObject = new ArrayObject($fruits);
|
||||
|
||||
// Try to use array key as property
|
||||
print_r($fruitsArrayObject->lemons);
|
||||
var_dump($fruitsArrayObject->lemons);
|
||||
// Set the flag so that the array keys can be used as properties of the ArrayObject
|
||||
$fruitsArrayObject->setFlags(ArrayObject::ARRAY_AS_PROPS);
|
||||
// Try it again
|
||||
print_r($fruitsArrayObject->lemons);
|
||||
|
||||
var_dump($fruitsArrayObject->lemons);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
Loading…
Reference in a new issue