<?php
if ($_POST)
var_dump(compact("_POST"));
-if (($json_last_error = json_last_error()))
+if (PHP_VERSION_ID >= 70000 && ($json_last_error = json_last_error()))
var_dump(compact("json_last_error"));
-if (($JSON_POST_ERROR = JSON_POST_ERROR) !== 3)
+if (($JSON_POST_ERROR = JSON_POST_ERROR) !== (PHP_VERSION_ID < 70000 ? 4 : 3))
var_dump(compact("JSON_POST_ERROR"));
if (($http_response_code = http_response_code()) != ini_get("json_post.onerror.response") && ini_get("json_post.onerror.response"))
var_dump(compact("http_response_code"));
--TEST--
json_post with malformed JSON [default] (https://github.com/m6w6/ext-json_post/issues/3)
---EXTENSIONS--
-json_post
--POST_RAW--
Content-Type: application/json
--TEST--
json_post with malformed JSON [response] (https://github.com/m6w6/ext-json_post/issues/3)
---EXTENSIONS--
-json_post
--INI--
json_post.onerror.response = 400
--POST_RAW--
--TEST--
json_post with malformed JSON [warning] (https://github.com/m6w6/ext-json_post/issues/3)
---EXTENSIONS--
-json_post
--INI--
json_post.onerror.warning = on
--POST_RAW--
error.inc
--EXPECTHEADERS--
--EXPECTF--
-Warning: json_post: json_decode failed with error code: 3 in %s on line %s
+Warning: json_post: json_decode failed with error code: %d in %s on line %s
DONE
--TEST--
json_post with malformed JSON [exit] (https://github.com/m6w6/ext-json_post/issues/3)
---EXTENSIONS--
-json_post
--INI--
json_post.onerror.exit = true
--POST_RAW--
--TEST--
json_post with malformed JSON [response override] (https://github.com/m6w6/ext-json_post/issues/3)
---EXTENSIONS--
-json_post
--INI--
json_post.onerror.response = 444
--POST_RAW--
--TEST--
json_post with malformed JSON [json_throw] (https://github.com/m6w6/ext-json_post/issues/3)
---EXTENSIONS--
-json_post
--INI--
json_post.flags = 4194305
--POST_RAW--