php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #41271 missing proto declarations for the json extension
Submitted: 2007-05-03 18:52 UTC Modified: 2007-05-25 13:25 UTC
From: jeffg at activestate dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: OS X
Private report: No CVE-ID: None
 [2007-05-03 18:52 UTC] jeffg at activestate dot com
Description:
------------
The json extension is missing proto doc strings for json_encode() and json_decode(), which causes source scanning scripts looking for these signatures to miss these two functions ( eg Rasmus' script ). A minor issue, but it would be nice if the json sources were more standardized.

Here is a diff, using today's snap:

--- php5.2-200705031830/ext/json/json.c 2007-04-13 15:31:12.000000000 -0700
+++ php5.2-snaps-altered/ext/json/json.c        2007-05-03 11:44:57.000000000 -0700
@@ -387,6 +387,9 @@
     return;
 }
 
+/* {{{ proto string json_encode(mixed $value)
+   Returns a string containing the JSON representation of value. */
+
 static PHP_FUNCTION(json_encode)
 {
     zval *parameter;
@@ -403,6 +406,9 @@
     smart_str_free(&buf);
 }
 
+/* {{{ proto string json_decode(string $json [bool $assoc])
+   Takes a JSON encoded string and converts it into a PHP variable. */
+
 static PHP_FUNCTION(json_decode)
 {
     char *parameter;


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-25 13:25 UTC] bjori@php.net
Thanks for the patch, fixed.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Nov 19 15:00:02 2025 UTC