PHPverse 2025

Voting

: max(seven, two)?
(Example: nine)

The Note You're Voting On

michaelgranados at gmail dot com
13 years ago
A way to check if you can call an method over a class:

<?php
function is_public_method(
/* string */$className,
/* string */$method
){
$classInstance = new ReflectionClass($className);
if (
$classInstance->hasMethod($method)) {
return
false;
}
$methodInstance = $instance->getMethod($method);
return
$methodInstance->isPublic();
}
?>

<< Back to user notes page

To Top