请高手详解method_exists方法

手册上搜method_exists,搜到这个
<?php
$directory = new Directory('.');
var_dump(method_exists($directory,'read'));//请解释一下,此处的read方法哪里来的,属于哪里,顺便举一个其它实例
?>

作者: tsuliuchao   发布时间: 2011-05-30

class say{
function hello(){
  echo "hello world";
  }
}
$a = new say;
if (method_exists($a,"hello")){
  echo "方法hello存在";
}else{
  echo "方法hello不存在";
}

作者: sibang   发布时间: 2011-05-30