Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

rustjson/php-rapidjson

Open more actions menu

Repository files navigation

php-rapidjson

Build Status

PHP Extension of rapidjson (not finished yet)

Requirement

PHP7

Install

git clone --recursive https://github.com/RustJason/php-rapidjson
cd php-rapidjson

phpize

./configure --with-php-config=/usr/local/php/php-7.0.0/bin/php-config

make && make test

Usage

$json = '{"name": "Jason", "age": 23, "arr":["c", "e"], "obj":{"subobj"}}';

$obj = new Rapidjson($json);

//traversal
foreach($obj as $k => $v) {
	echo "key = $k";
	var_dump($v);
}

//modify and reencode
$obj['name'] = 'Young';
var_dump($obj['name']);
echo $obj;


//ongoing 
//Array support and obj support

#Result of benchmark(gcc -O3) Script:

json.len = 206082
string(6) "memeda"
newjson.len = 202313
Rapidjson.time: 2.2114210128784
Rapidjson.mem: 204912
string(6) "memeda"
newjson.len = 218756
json_decode.time: 15.593321800232
json_decode.mem: 1543856

About

PHP Extension of rapidjson

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.