JSON patch doesn't seem to be in latest snapshot.

[email protected] (Richard Quadling)
Newsgroups php.internals.win
Message-ID <[email protected]>
Hi.

Just looking into ...

+2009-05-14  Scott MacVicar  <[email protected]>
+
+    * (PHP_5_3)
+      NEWS:
+      BFN
+
+    * (PHP_5_3)
+      ext/json/JSON_parser.c
+      ext/json/JSON_parser.h
+      ext/json/json.c:
+      MFH Allow a custom recursion depth to be specified for json_decode()
+
+    * ext/json/json.c:
+      Throw an error rather than silently changing to the default.
+

CVS for 5.3 (http://cvs.php.net/viewvc.cgi/php-src/ext/json/?pathrev=PHP_5_3)


  JSON_parser.c		 1.1.2.12.2.10	 10 hours	 scottmac	 MFH Allow a
custom recursion depth to be specified for json_decode()
  JSON_parser.h		 1.1.2.1.2.3	 10 hours	 scottmac	 MFH Allow a custom
recursion depth to be specified for json_decode()
  json.c		 1.9.2.19.2.20	 10 hours	 scottmac	 MFH Allow a custom
recursion depth to be specified for json_decode()

Taking latest snapshots ...

php --re json

shows ...

Extension [ <persistent> extension #11 json version 1.2.1 ] {

  - Constants [10] {
    Constant [ integer JSON_HEX_TAG ] { 1 }
    Constant [ integer JSON_HEX_AMP ] { 2 }
    Constant [ integer JSON_HEX_APOS ] { 4 }
    Constant [ integer JSON_HEX_QUOT ] { 8 }
    Constant [ integer JSON_FORCE_OBJECT ] { 16 }
    Constant [ integer JSON_ERROR_NONE ] { 0 }
    Constant [ integer JSON_ERROR_DEPTH ] { 1 }
    Constant [ integer JSON_ERROR_STATE_MISMATCH ] { 2 }
    Constant [ integer JSON_ERROR_CTRL_CHAR ] { 3 }
    Constant [ integer JSON_ERROR_SYNTAX ] { 4 }
  }

  - Functions {
    Function [ <internal:json> function json_encode ] {

      - Parameters [2] {
        Parameter #0 [ <required> $value ]
        Parameter #1 [ <optional> $options ]
      }
    }
    Function [ <internal:json> function json_decode ] {

      - Parameters [2] {
        Parameter #0 [ <required> $json ]
        Parameter #1 [ <optional> $assoc ]
      }
    }
    Function [ <internal:json> function json_last_error ] {

      - Parameters [0] {
      }
    }
  }
}


NOTE: No third parameter.

and ...

php -n -v

PHP 5.3.0RC3-dev (cli) (built: May 15 2009 09:14:36)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

php -n -r "var_dump(json_encode(array(array(array(array('foobar')))),False,1));"

Warning: json_encode() expects at most 2 parameters, 3 given in
Command line code on line 1
NULL


Regards,

Richard.

-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.