First scripts and browser setup
After the first four scripts, vary how the browser starts and what environment the page sees.
Headless launch
Launch headless Chromium with Playwright PHP, open a web page, and print its title. A runnable example to check your installation.
Choose a browser
Loop over Chromium, Firefox, and WebKit and print versions.
Change the viewport
Read and change the viewport, then screenshot each size.
Storage state
Save cookies and storage to a JSON file, then reuse them in a fresh browser context.