-3
我需要一個變量傳遞到承諾Guzzlephp承諾可變
<?php
$var = 'test';
$client = new Client();
$request = new Request('POST', 'https://url/');
$promise = $client->sendAsync($request, $options)->then(function ($response) {
$echo $var;
});
$promise->wait();
'$回聲是$ var;'? – walther