On PHP 8.2+, assigning keys from the API response that are not declared as properties on ipinfo\ipinfo\Details triggers:
Deprecated: Creation of dynamic property ipinfo\ipinfo\Details::$readme is deprecated
This happens in Details::__construct() because it loops over $raw_details and assigns $this->$property = $value for every key, while Details only declares a fixed list of properties. The API can return additional keys (e.g. readme).
Environment
- Package:
ipinfo/ipinfo v3.5.0
- PHP: 8.2+ (also observed on 8.3)
Minimal reproduction
new \ipinfo\ipinfo\Details([
'ip' => '8.8.8.8',
'readme' => 'https://ipinfo.io/missingauth',
]);
On PHP 8.2+, assigning keys from the API response that are not declared as properties on
ipinfo\ipinfo\Detailstriggers:Deprecated: Creation of dynamic property ipinfo\ipinfo\Details::$readme is deprecatedThis happens in
Details::__construct()because it loops over$raw_detailsand assigns$this->$property = $valuefor every key, whileDetailsonly declares a fixed list of properties. The API can return additional keys (e.g.readme).Environment
ipinfo/ipinfov3.5.0Minimal reproduction