# wpide/3.4.7/_compat.php

WPIDE – File Manager &amp; Code Editor, version 3.4.7. 19 lines.

- Page: https://pluginprobe.com/plugins/wpide/3.4.7/code/_compat.php
- Raw: https://pluginprobe.com/plugins/wpide/3.4.7/raw/_compat.php
- Modified: 2022-07-30T20:33:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wpide/3.4.7/code/_compat.php#L10-L20`.

```php
<?php
if ( ! function_exists( 'str_contains' ) ) {
    /**
     * Polyfill for `str_contains()` function added in PHP 8.0. since WP 5.9.0
     *
     * Performs a case-sensitive check indicating if needle is
     * contained in haystack.
     *
     * @param string $haystack The string to search in.
     * @param string $needle   The substring to search for in the haystack.
     * @return bool True if `$needle` is in `$haystack`, otherwise false.
     *@since 1.0.0
     *
     */
    function str_contains(string $haystack, string $needle ): bool
    {
        return ( '' === $needle || false !== strpos( $haystack, $needle ) );
    }
}
```
