php changedcli-sdks-libraries/sdks/php
Recorded here
Lines+4added
Lines−2removed
From line
72
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits7to this page, all time
The whole hunk
from line 72, old and new numbered
/
from line 72
7272Streaming requires an HTTP client that returns the response body incrementally. When Guzzle is the discovered PSR-18 client, the SDK configures it for streaming automatically. With a buffering client, the `foreach` loop yields every event at once when the response completes instead of incrementally; if you observe that symptom, install Guzzle or supply a streaming-capable PSR-18 client through the `streamingTransporter` request option:
7373
7474```php
75$client = new Anthropic\Client(
76 requestOptions: Anthropic\RequestOptions::with(streamingTransporter: $myStreamingClient),
75$client = new \Anthropic\Client(
76 requestOptions: \Anthropic\RequestOptions::with(streamingTransporter: $myStreamingClient),
7777);
7878```
7979
from line 160
160160 echo $item->id, PHP_EOL;
161161}
162162// make additional network requests to fetch items from all pages, including and after the current page
163// ...
163164foreach ($page->pagingEachItem() as $item) {
164165 echo $item->id, PHP_EOL;
166// ...
165167}
166168```
167169
No line in this hunk matches that.