Ejemplo n.º 1
0
Debug::dump(isset($hashtable->jim));
echo "Contains ->jack?\n";
Debug::dump(isset($hashtable->jack));
echo "Contains ->mary?\n";
Debug::dump(isset($hashtable->mary));
// IMap::offsetGet
try {
    echo "Getting ['jim']\n";
    Debug::dump($hashtable['jim']);
} catch (Exception $e) {
    echo get_class($e), ': ', $e->getMessage(), "\n\n";
}
// IMap::offsetGet
try {
    echo "Getting ['jim'] with throwKeyNotFound\n";
    $hashtable->throwKeyNotFound();
    Debug::dump($hashtable['jim']);
} catch (Exception $e) {
    echo get_class($e), ': ', $e->getMessage(), "\n\n";
}
try {
    echo "Getting ['mary']\n";
    Debug::dump($hashtable['mary']);
} catch (Exception $e) {
    echo get_class($e), ': ', $e->getMessage(), "\n\n";
}
// IMap::__get
try {
    echo "Getting ->jim\n";
    Debug::dump($hashtable->jim);
} catch (Exception $e) {