array( 'verify_peer' => false, 'verify_peer_name' => false ))); libxml_set_streams_context($context);*/ $xml = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA); $this->xml = $xml; return $this; } catch (\Exception $e) { echo 'Catch in : ', $e->getMessage(), "\n"; } } /** * Retrieves the last update time from feed * * @return string The timestamp of the last update */ public function lastUpdate(): string { $feedUpdateTime = new DateTimeImmutable((string)$this->xml->updated); return $feedUpdateTime->format("U"); } }