class MyClass { private function myPrivateMethod() { // ... } public function myPublicMethod() { // ... } } $reflectionClass = new ReflectionClass('MyClass'); $reflectionMethod = $reflectionClass->getMethod('myPrivateMethod'); echo $reflectionMethod->isPrivate(); // Outputs 1 $reflectionMethod = $reflectionClass->getMethod('myPublicMethod'); echo $reflectionMethod->isPrivate(); // Outputs 0In this example, we define a class with two methods, one private and one public. We then create a new instance of the ReflectionClass class passing in the name of our class. We then use the getMethod method of the ReflectionClass class to get instances of each of our methods. We then use the isPrivate method of the ReflectionMethod class to determine whether each method is private or not. The package library that provides the ReflectionMethod class is the PHP Reflection library. This library provides a set of classes and functions that allows developers to introspect and manipulate PHP objects at runtime. It is included with PHP by default and does not require any additional installations or configurations.