Hey everyone,
I'm currently working on a PHP project and I've encountered a situation where I need to handle comparisons or equality checks with an enumeration. I have an enumeration defined in my code and I'm not sure how to compare or check values against it.
Here's an example of what I mean:
```php
enum Fruit {
case APPLE;
case BANANA;
case ORANGE;
}
$fruit = Fruit::APPLE;
```
Now, let's say I want to compare the value of `$fruit` with one of the enumeration values, like `Fruit::BANANA`. How can I do that? Similarly, how can I perform equality checks between enumeration values?
I'd really appreciate any guidance or code snippets you can provide to help me handle these comparisons or equality checks with an enumeration in PHP.
Thank you in advance for your help!

Hey there,
When it comes to handling comparisons or equality checks with an enumeration in PHP, one method that I find quite convenient is using the `in_array()` function. Here's an example to show you how it works:
In the above code, we utilize the `in_array()` function to check if `$fruit` exists in the array of valid enumeration values. By specifying the third argument as `true`, we enforce strict type checking. If the value is found, it will output "It is a known fruit!".
Feel free to adapt this code to your particular use case. If you have any further queries, feel free to ask. Best of luck with your PHP project!