Example #1
0
}
try {
    echo "Adding Mary twice using add()\n";
    $hashtable->add('mary', $mary);
} catch (Exception $e) {
    echo get_class($e), ': ', $e->getMessage(), "\n\n";
}
try {
    echo "Adding Mary twice using __set()\n";
    $hashtable->mary = $mary;
} catch (Exception $e) {
    echo get_class($e), ': ', $e->getMessage(), "\n\n";
}
try {
    echo "Adding Jack using append\n";
    $hashtable->append($jack);
} catch (Exception $e) {
    echo get_class($e), ': ', $e->getMessage(), "\n\n";
}
// (array) IMap
echo "(array):\n";
Debug::dump((array) $hashtable);
// IMap::getKeys()
echo "getKeys:\n";
Debug::dump($hashtable->getKeys());
// IMap::contains
echo "Contains Jack?\n";
Debug::dump($hashtable->contains($jack));
echo "Contains Mary?\n";
Debug::dump($hashtable->contains($mary));
try {