--TEST--
-json_post
+json_post with > 32bits integer as float on 32bits
--SKIPIF--
<?php
-extension_loaded("json_post")) or die("skip need json_post support\n");
+extension_loaded("json_post") or die("skip need json_post support\n");
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bits platform only");
?>
--INI--
-json_post.flags=2;JSON_BIGINT_AS_STRING
+json_post.flags=0
--POST_RAW--
Content-type: text/json
{
- "null": null,
- "bool": true,
- "int": 123,
- "bigint": 36893488147419103232,
- "float": 123.123,
- "string": "Hello World",
- "array": [1,2,3],
- "object": {
- "array": [1,2,3],
- "unicode": "\u00D6sterreich"
- }
+ "bigint": 12345678901234
}
--FILE--
<?php
-var_dump($_POST, json_last_error_msg());
+var_dump($_POST, json_last_error());
?>
+Done
--EXPECTF--
-object(stdClass)#%d (8) {
- ["null"]=>
- NULL
- ["bool"]=>
- bool(true)
- ["int"]=>
- int(123)
+object(stdClass)#%d (1) {
["bigint"]=>
- string(20) "36893488147419103232"
- ["float"]=>
- float(123.123)
- ["string"]=>
- string(11) "Hello World"
- ["array"]=>
- array(3) {
- [0]=>
- int(1)
- [1]=>
- int(2)
- [2]=>
- int(3)
- }
- ["object"]=>
- object(stdClass)#%d (2) {
- ["array"]=>
- array(3) {
- [0]=>
- int(1)
- [1]=>
- int(2)
- [2]=>
- int(3)
- }
- ["unicode"]=>
- string(11) "Österreich"
- }
+ float(12345678901234)
}
-string(8) "No error"
\ No newline at end of file
+int(0)
+Done
\ No newline at end of file