cvs: php-src /ext/json json.c
| From: | Andrei Zmievski | Date: | Thu, 19 Oct 2006 20:24:25 +0000 |
| Subject: | cvs: php-src /ext/json json.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-41171@lists.php.net to get a copy of this message | ||
andrei Thu Oct 19 20:24:25 2006 UTC
Modified files:
/php-src/ext/json json.c
Log:
Clarify why the result of json_encode() is a binary string.
http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.18&r2=1.19&diff_format=u
Index: php-src/ext/json/json.c
diff -u php-src/ext/json/json.c:1.18 php-src/ext/json/json.c:1.19
--- php-src/ext/json/json.c:1.18 Thu Oct 19 10:12:19 2006
+++ php-src/ext/json/json.c Thu Oct 19 20:24:25 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: json.c,v 1.18 2006/10/19 10:12:19 tony2001 Exp $ */
+/* $Id: json.c,v 1.19 2006/10/19 20:24:25 andrei Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -416,6 +416,10 @@
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);