Advertisement
ObjectClass

GovnoCode

Jan 18th, 2019
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. <?php
  2.  
  3. class Curl
  4. {
  5.     protected static $userAgent = 'Mozilla/5.0 (Linux; Android 6.0.1; SM-G532F Build/MMB29T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.103 YaBrowser/18.7.1.575.00 Mobile Safari/537.36';
  6.     protected static $arrParams = [
  7.         'error' => false,
  8.         'headers' => false,
  9.         'user_agent' => null,
  10.     ];
  11.    
  12.     public function __construct ($arrParams = [])
  13.     {
  14.         $this->params = (object) array_merge(self::$arrParams, $arrParams);
  15.        
  16.         if (empty ($this->params->user_agent)) $this->params->user_agent = self::$userAgent;
  17.     }
  18.  
  19. var_dump($this->params); // ошибочка
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement