class B
{
 function getB()
 {
  return "nullpo";
 }


class A
{
 var $elements = array();

 function newElement()
 {
  $element[] = new B;
 }

 function getCurrentElement()
 {
  echo end($this->elements)->getB();
 }
}

>  end($this->elements)->getB();
こんな感じで配列にはいってる最終の要素のメソッドを呼び出したいんですが
うまくいかないですー

どこがおかしいかってのと
どうやったらうまくいくかってのをどうかご教授ください