Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Count the number of substring occurrences
<?php substr_count(    string $haystack,    string $needle,    int $offset = 0,    ?int $length = null): int
<?php             return;

        }



        $expectedErrors = \substr_count($contents, '#[');

        $actualErrors   = 0;



        while (empty($contents) === false && \substr($contents, 0, 2) === '#[') {
<?php             $length          = \strlen($contentStripped);

            if ($contentStripped !== $content) {


                $length += \substr_count($content, '$');

            }

        }