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 rapidjson traversal value --SKIPIF-- <?php if (!extension_loaded("rapid..
Decoded Output download
--TEST--
Check for rapidjson traversal value
--SKIPIF--
<?php if (!extension_loaded("rapidjson")) print "skip"; ?>
--FILE--
<?php
$str = '{"boy": true, "name":"hello", "city": "beijing", "int":0, "arr":[1,3], "obj":{"ab":"cd"}, "null": null}';
$obj = new Rapidjson();
$obj->parse($str);
foreach ($obj as $key => $val) {
echo "key = $key, val = ";
var_dump($val);
}
?>
--EXPECT--
key = boy, val = bool(true)
key = name, val = string(5) "hello"
key = city, val = string(7) "beijing"
key = int, val = int(0)
key = arr, val = NULL
key = obj, val = NULL
key = null, val = NULL
Did this file decode correctly?
Original Code
--TEST--
Check for rapidjson traversal value
--SKIPIF--
<?php if (!extension_loaded("rapidjson")) print "skip"; ?>
--FILE--
<?php
$str = '{"boy": true, "name":"hello", "city": "beijing", "int":0, "arr":[1,3], "obj":{"ab":"cd"}, "null": null}';
$obj = new Rapidjson();
$obj->parse($str);
foreach ($obj as $key => $val) {
echo "key = $key, val = ";
var_dump($val);
}
?>
--EXPECT--
key = boy, val = bool(true)
key = name, val = string(5) "hello"
key = city, val = string(7) "beijing"
key = int, val = int(0)
key = arr, val = NULL
key = obj, val = NULL
key = null, val = NULL
Function Calls
extension_loaded | 1 |
Stats
MD5 | a271b7377b781798448e91699289d510 |
Eval Count | 0 |
Decode Time | 138 ms |