-1

i had flagged the erorr line "this line report error..."

i had try modify "public $config" to "public $config=array();",but the error exist also.

<?php
namespace Bigxu;
// https://github.com/svyatov/CurlWrapper/blob/master/CurlWrapper.php

class WrappCurl {

    public  $config;
    public $ch;

    public function __construct(array $config) {
    $this->ch =  curl_init();

    $this->$config = [  // this line report error.............
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_MAXREDIRS => 5,
        CURLOPT_USERAGENT => 'listenSever From listen.smanual.com/v1.00',
        CURLOPT_TIMEOUT => 5,
        CURLOPT_CONNECTTIMEOUT => 5,
    ];
    }
    if(is_array($config) && !empty($config)) {
       // exit;
        $this->config = array_merge($this->config,$config);
    }
}
Xiu Hong
  • 181
  • 2
  • 8

1 Answers1

2

This is a simple syntax error.

You need to change this:

$this->$config = [

to this:

$this->config = [
Jocke Med Kniven
  • 3,909
  • 1
  • 22
  • 23