From 4e7f1d7ba8eeb9ab5b97039a84da528d5a39a75e Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Tue, 27 Oct 2015 22:00:05 -0700 Subject: [PATCH] Fix PHP 5.3 "Fatal error: Using $this when not in object context" --- src/Curl/Curl.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Curl/Curl.php b/src/Curl/Curl.php index a089ad5..902924c 100644 --- a/src/Curl/Curl.php +++ b/src/Curl/Curl.php @@ -544,9 +544,9 @@ class Curl public function setCookie($key, $value) { $this->cookies[$key] = $value; - $this->setOpt(CURLOPT_COOKIE, implode('; ', array_map(function($this, $name) { - return $name . '=' . str_replace(' ', '%20', $this->cookies[$name]); - }, array($this), array_keys($this->cookies)))); + $this->setOpt(CURLOPT_COOKIE, implode('; ', array_map(function($k, $v) { + return $k . '=' . str_replace(' ', '%20', $v); + }, array_keys($this->cookies), array_values($this->cookies)))); } /**