Mid-Level
October 4, 2026

Spot the bug: Symfony

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

php
1<?php
2
3namespace App\Controller;
4
5use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
6use Symfony\Component\HttpFoundation\Request;
7use Symfony\Component\HttpFoundation\Response;
8use Symfony\Component\Routing\Attribute\Route;
9
10class ProductController extends AbstractController
11{
12    #[Route('/products/{id}', name: 'product_show')]
13    public function show(Request $request, ProductRepository $repo): Response
14    {
15        $id = $request->query->get('id');
16        $product = $repo->find($id);
17
18        return $this->render('product/show.html.twig', [
19            'product' => $product,
20        ]);
21    }
22}
23

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