try { echo "Adding foo using []\n"; $list[] = $foo; } catch (Exception $e) { echo get_class($e), ': ', $e->getMessage(), "\n\n"; } // (array) IList echo "(array):\n"; Debug::dump((array) $list); // extension method echo "join() via extension method:\n"; Debug::dump($list->join(', ')); // undeclared method try { echo "undeclared method:\n"; $list->test(); } catch (Exception $e) { echo get_class($e), ': ', $e->getMessage(), "\n\n"; } // IList::insertAt() echo "Adding Larry using insertAt()\n"; Debug::dump($list->insertAt(0, $larry)); echo "Adding Larry using insertAt()\n"; Debug::dump($list->insertAt(4, $larry)); try { echo "Adding Larry using insertAt()\n"; Debug::dump($list->insertAt(6, $larry)); } catch (Exception $e) { echo get_class($e), ': ', $e->getMessage(), "\n\n"; } // (array) IList