PHPackages                             egorgrushko/simplejsonrpc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. egorgrushko/simplejsonrpc

ActiveLibrary[API Development](/categories/api)

egorgrushko/simplejsonrpc
=========================

Implementation of JSON-RPC for PHP 5.4+

06PHP

Since Feb 4Pushed 9y ago1 watchersCompare

[ Source](https://github.com/egorgrushko/SimpleJSONRPC)[ Packagist](https://packagist.org/packages/egorgrushko/simplejsonrpc)[ RSS](/packages/egorgrushko-simplejsonrpc/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

SimpleJSONRPC
=============

[](#simplejsonrpc)

Implementation of JSON-RPC for PHP 5.4+. Can be used to create API service for your project. Specification:

Install
-------

[](#install)

Via Composer

```
$ composer require egorgrushko/simplejsonrpc
```

Usage
-----

[](#usage)

Example implementation of

```
class Foo
{
    public $data;

    public function __construct($data)
    {
        $this->data = $data;
    }

    public function __destruct()
    {

    }

    public function sum($param1, $param2, $param3)
    {
        return $param1 + $param2 + $param3;
    }

    public function subtract($minuend, $subtrahend)
    {
        return $minuend - $subtrahend;
    }

    public function notify_hello()
    {
        return 2 + 2;
    }

    public function get_data()
    {
        return $this->data;
    }
}
$request = isset($_REQUEST['request']) ? $_REQUEST['request'] : null; // Read JSON string

$fooObject = new Foo(array("hello", 0)); // Create the class object with the required methods and properties

$server = new SimpleJSONRPCServer($fooObject); // Create server object

$fooObject->data[1] = 5; // You can change properties before or between processing RPC

echo $server->process($request); // Execute the JSONRPC string processing. Returns result of processing
```

License
-------

[](#license)

The MIT License (MIT). Please see License File (LICENSE.md) for more information.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ba3110695f8469e39db2c1a9344efd566140447c3ad1709611c3bf8d77ba25fe?d=identicon)[Egor Grushko](/maintainers/Egor%20Grushko)

### Embed Badge

![Health badge](/badges/egorgrushko-simplejsonrpc/health.svg)

```
[![Health](https://phpackages.com/badges/egorgrushko-simplejsonrpc/health.svg)](https://phpackages.com/packages/egorgrushko-simplejsonrpc)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
