[Ur] How to design JSON interface?

Marc Weber marco-oweber at gmx.de
Thu Dec 2 13:00:27 EST 2010


> is recursive types beyond lists;
They can't be serialized AFAIK. There is no representation.
eg 
  var d1 = {}
  d1.dict = d1;

So it's fine.

Eg this is what PHP is doing:

  $a = array();
  $a['dict'] =& $a; // be careful and assign a reference. = would make a copy!
  echo json_encode($a);

  || Warning: json_encode(): recursion detected in /home/marc/test.php on line 5
  || {"dict":{"dict":null}}


I'll give it a try. Thank you for being that responsive. :)

Yours
Marc Weber



More information about the Ur mailing list