protected function findall(string $haystack, $needle): array
    {
        $lastPos = 0;
        $positions = [];
        while (($lastPos = strpos($haystack, $needle, $lastPos)) !== false) {
            $positions[] = $lastPos;
            $lastPos = $lastPos + 1;
        }
        return $positions;
    }