read(); if ($str) { $decoded = @json_decode($str, $assoc, $depth); $err = json_last_error(); if ($err !== JSON_ERROR_NONE) { throw new \RuntimeException('Reading JSON failed: ' . json_last_error_msg(), $err); } return $decoded; } } }