Skip to content

Commit

Permalink
JSON_BIGINT_AS_STRING is not supported in some Linux packages [Closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 4, 2014
1 parent 0ec0850 commit e0ebfda
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/twitter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,9 @@ public function request($resource, $method, array $data = NULL, array $files = N
throw new TwitterException('Server error: ' . curl_error($curl));
}

$payload = version_compare(PHP_VERSION, '5.4.0') >= 0 ?
@json_decode($result, FALSE, 128, JSON_BIGINT_AS_STRING) : @json_decode($result); // intentionally @
$payload = defined('JSON_BIGINT_AS_STRING')
? @json_decode($result, FALSE, 128, JSON_BIGINT_AS_STRING)
: @json_decode($result); // intentionally @

if ($payload === FALSE) {
throw new TwitterException('Invalid server response');
Expand Down

0 comments on commit e0ebfda

Please sign in to comment.