. */ require __DIR__.'/../vendor/autoload.php'; use Sikofitt\UserAgent\UserAgent; // Simple default example $userAgent = UserAgent::create(); // PHP/7.1-70110 (sikofitt/user-agent; Linux x86_64) // PHP/7.1.10-1+ubuntu17.04.1+deb.sury.org+1; // guzzlehttp/6.2.1 curl/7.52.1 (https://packagist.org/sikofitt/user-agent) // If guzzle is not installed the user agent would be - // PHP/7.1-70110 (sikofitt/user-agent; Linux x86_64) // PHP/7.1.10-1+ubuntu17.04.1+deb.sury.org+1; // (https://packagist.org/sikofitt/user-agent) // Extending $ua = new class extends UserAgent { protected static $format = 'PHP/%d.%d.%d'; protected static $params = [ PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION ]; }; $userAgent2 = $ua::create(); // PHP/7.1.10