+$client->attach($observer = new class implements SplObserver {
+ public $data = [];
+
+ #[ReturnTypeWillChange]
+ function update(SplSubject $client, $req = null, $progress = null) {
+ $ti = $client->getTransferInfo($req);
+ if (isset($ti->tls_session["internals"])) {
+ foreach ((array) $ti->tls_session["internals"] as $key => $val) {
+ if (!isset($this->data[$key]) || $this->data[$key] < $val) {
+ $this->data[$key] = $val;
+ }
+ }
+ }
+ }
+});
+