Arrays Learning Mode
What will this script output?
// Array of available fruits
$fruits = array("lemons" => 1, "oranges" => 4, "bananas" => 5,
"apples" => 10);
$fruitsArrayObject = new ArrayObject($fruits);
$fruitsArrayObject->setFlags(ArrayObject::ARRAY_AS_PROPS);
// Try to use array key as property
var_dump($fruitsArrayObject->lemons);
|
|
|
|