- json_decode: documentation ( source)
- print_r: documentation ( source)
- var_export: documentation ( source)
<?php
$o = json_decode("{}");//new stdClass;
$id = -99;
$a = array('id' => $id, 'name' => 'bill');
$o->$id = $a;
eval('$b = ' . var_export($o, true) . ';');
print_r($b);