Hi,
Here is a useful function that you can use to check classes methods access e.g whether it is public, private or static or both..
here it goes:
<?php
class myClass {
private $private1;
static $static1;
public $public1;
public function publ() {
}
private function priv() {
}
private static function privstatic() {
}
public static function publstatic() {
}
static function mytest() {
}
}
function is_class_method($type="public", $method, $class) {
$refl = new ReflectionMethod($class, $method);
switch($type) {
case "static":
return $refl->isStatic();
break;
case "public":
return $refl->isPublic();
break;
case "private":
return $refl->isPrivate();
break;
}
}
var_dump(is_class_method("static", "privstatic", "myClass")); var_dump(is_class_method("private", "privstatic", "myClass")); var_dump(is_class_method("private", "publstatic", "myClass")); ?>