#!/www/server/bin/php -qC "bar", "qux", 42 => "quux")), '{"foo":"bar","0":"qux","42":"quux"}', 'key-value pairs' ); is( itjs::serialize(array('foo' => array('bar' => array("qux", 42)))), '{"foo":{"bar":["qux",42]}}', 'nested arrays' ); is( itjs::serialize(array('import' => array('function' => array(true, 42)))), '{"import":{"function":[true,42]}}', 'keywords' ); is( itjs::serialize(array('foo"foo' => "bar")), '{"foo\"foo":"bar"}', "quote ' in keys" ); is( itjs::serialize(""), '"<\\/script>"', "quote slashes" ); is( itjs::serialize("hellö"), '"hellö"', "don't encode utf8" );