Intermedio
4 ottobre 2026

Trova il bug: Symfony

Uno snippet di codice. Trova il bug, o dimostra che non ce n'è.

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

Clicca sulle righe che causano il problema.

Il tuo verdetto

Un tentativo al giorno. La risposta appare subito dopo.

Mantieni la tua serie

Crea un account per conservare la tua serie e seguire i tuoi progressi.

Crea un account