From e0ebfda2b4414ae78ac9427ac70540e2ebcf04e6 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 5 Nov 2014 00:11:04 +0100 Subject: [PATCH] JSON_BIGINT_AS_STRING is not supported in some Linux packages [Closes #41] --- src/twitter.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/twitter.class.php b/src/twitter.class.php index 5bea952..fbdb7f7 100644 --- a/src/twitter.class.php +++ b/src/twitter.class.php @@ -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');