#1078·PHP-Parser

Support: How to parse a statement and methods

Author: tacmanCreated Mar 26, 2025Updated Mar 26, 2025

What an amazing tool! I rarely use it directly, but many of the tools I use depend on it.

But today I'm trying to use it directly, and stuck on how to loop through a $stmt.

php
    public function testDemo(): void
    {
        $browser = $this->pantherBrowser()
            ->visit('/')
            ->assertOn('/')
            ->takeScreenshot('home.png')
            ->visit('/en/batsi#tab-locations')
            ->takeScreenshot('basti-locations.png')
        ;
        $browser
            ->click('#tab-artists')
            ->takeScreenshot('artists.png')
            ;
    }

I want to loop through each statement and get back each method call, along with its parameters.

Can anyone point me in the right direction? Thx.