Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
--TEST-- Check for jsonrpc presence --SKIPIF-- <?php if (!extension_loaded("jsonrpc")) pri..
Decoded Output download
--TEST--
Check for jsonrpc presence
--SKIPIF--
<?php if (!extension_loaded("jsonrpc")) print "skip"; ?>
--FILE--
<?php
$payload = array(
"jsonrpc"=>"2.0",
"id"=>123456,
"method"=>"addition",
"params"=>array(2,3)
);
$server = new Jsonrpc_Server(json_encode($payload));
/*
$server->register('addition', function ($a, $b) {
return $a + $b;
});
*/
/*
$add = function ($a, $b){
return $a + $b;
};
$server->register('addition', $add);
*/
/*
function add ($a, $b){
return $a + $b;
}
$server->register('addition', 'add');
*/
class A
{
static public function add($a, $b)
{
return $a + $b;
}
}
$server->register('addition', 'A::add');
echo $server->execute();
?>
--EXPECT--
{"jsonrpc":"2.0","id":123456,"result":5}
Did this file decode correctly?
Original Code
--TEST--
Check for jsonrpc presence
--SKIPIF--
<?php if (!extension_loaded("jsonrpc")) print "skip"; ?>
--FILE--
<?php
$payload = array(
"jsonrpc"=>"2.0",
"id"=>123456,
"method"=>"addition",
"params"=>array(2,3)
);
$server = new Jsonrpc_Server(json_encode($payload));
/*
$server->register('addition', function ($a, $b) {
return $a + $b;
});
*/
/*
$add = function ($a, $b){
return $a + $b;
};
$server->register('addition', $add);
*/
/*
function add ($a, $b){
return $a + $b;
}
$server->register('addition', 'add');
*/
class A
{
static public function add($a, $b)
{
return $a + $b;
}
}
$server->register('addition', 'A::add');
echo $server->execute();
?>
--EXPECT--
{"jsonrpc":"2.0","id":123456,"result":5}
Function Calls
extension_loaded | 1 |
Stats
MD5 | 00579b0e5b2b668a59b32dc6d54b1739 |
Eval Count | 0 |
Decode Time | 118 ms |