]> granicus.if.org Git - php/commitdiff
Clarify why the result of json_encode() is a binary string.
authorAndrei Zmievski <andrei@php.net>
Thu, 19 Oct 2006 20:24:25 +0000 (20:24 +0000)
committerAndrei Zmievski <andrei@php.net>
Thu, 19 Oct 2006 20:24:25 +0000 (20:24 +0000)
ext/json/json.c

index 20c3d72434eac048d03c81f40280c9a0969e0b87..045ef35d1f68b046316c318829c691aa36c31f53 100644 (file)
@@ -416,6 +416,10 @@ PHP_FUNCTION(json_encode)
 
     json_encode_r(&buf, parameter TSRMLS_CC);
 
+       /*
+        * Return as binary string, since the result is 99% likely to be just
+        * echo'ed out and we want to avoid overhead of double conversion.
+        */
     ZVAL_STRINGL(return_value, buf.c, buf.len, 1);
 
     smart_str_free(&buf);