コード例 #1
0
ファイル: JWT.php プロジェクト: purchased-at/sdk-php
 /**
  * @param object|array $input A PHP object or array
  *
  * @return string JSON representation of the PHP object or array
  */
 public static function jsonEncode($input)
 {
     $json = json_encode($input);
     if (function_exists('json_last_error') && ($errno = json_last_error())) {
         JWT::handleJsonError($errno);
     } else {
         if ($json === 'null' && $input !== null) {
             throw new DomainException('Null result with non-null input');
         }
     }
     return $json;
 }