Mid-Level
November 18, 2026

Spot the bug: Symfony

One snippet. Find the bug, or prove there isn't one.

php
1<?php
2
3namespace App\Service;
4
5class SlugGenerator
6{
7    public function generate(string $title): string
8    {
9        $slug = mb_strtolower($title, 'UTF-8');
10        $slug = preg_replace('/[^\p{L}\d]+/u', '-', $slug);
11
12        return trim($slug, '-');
13    }
14}

Click the lines that carry the problem.

Your verdict

One attempt per day. The answer shows up right after.

Keep your streak

Create an account to keep your streak and track your progress.

Create an account