A breakpoint in a busy loop needs a condition, a PHP expression that must be true for Xdebug 16,266 to stop (VS Code 550 : right-click it, Edit Condition). For web requests, start_with_request=trigger starts a session only when the request carries XDEBUG_TRIGGER as a cookie, GET or POST value; set xdebug.trigger_value to a secret. Here the shop runs under php -S 127.0.0.1:8221 -t public:
php dbgp.php "breakpoint_set -t conditional -f file:///app/src/Cart.php -n 17 -- \$qty > 2" \
'run' 'property_get -n $total' 'property_get -n $sku' 'run' &
curl -sg -b XDEBUG_TRIGGER=1 \
'http://127.0.0.1:8221/?sku[BK-SQL-01]=1&sku[BK-SQL-02]=2&sku[AC-MUG-01]=3'... -> property_get -i 3 -n $total <- <response command="property_get" transaction_id="3"> <property name="$total" fullname="$total" type="int"><![CDATA[10250]]></property></response> ... Total: 138.50
The first two lines (10250 cents) ran through; the break came on the mug, quantity 3. If a triggered request does not stop, read xdebug.log: with no editor listening it ends in ERR: Could not connect to debugging client. Tried: localhost:9003: start the listener, open the firewall, or fix xdebug.client_host (under Docker 514 or WSL2 6 , xdebug://gateway).