class MyClass { public function __destruct() { // Destructor code here } } $myMethod = new ReflectionMethod('MyClass', '__destruct'); if ($myMethod->isDestructor()) { echo "This method is a destructor."; } else { echo "This method is not a destructor."; }In this example, we create a new class called MyClass that has a destructor method. We then use the ReflectionMethod class to retrieve information about the __destruct method and use the isDestructor method to determine if it is actually a destructor. The package library that this code belongs to is the PHP Standard Library. The ReflectionMethod class is a built-in PHP class that is included in all installations of PHP, making it part of the standard library.