ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     --TEST--
PHPC-592: Property name corrupted when unserializing 64-bit integer on 32-bit platform
--SKIPIF--
<?php if (4 !== PHP_INT_SIZE) { die('skip Only for 32-bit platform'); } ?>
--FILE--
<?php

require_once __DIR__ . '/../utils/basic.inc';

$tests = [
    '{ "x": { "$numberLong": "-2147483648" }}',
    '{ "x": { "$numberLong": "2147483647" }}',
    '{ "x": { "$numberLong": "4294967294" }}',
    '{ "x": { "$numberLong": "4294967295" }}',
    '{ "x": { "$numberLong": "9223372036854775807" }}',
    '{ "longFieldName": { "$numberLong": "-2147483648" }}',
    '{ "longFieldName": { "$numberLong": "2147483647" }}',
    '{ "longFieldName": { "$numberLong": "4294967294" }}',
    '{ "longFieldName": { "$numberLong": "4294967295" }}',
    '{ "longFieldName": { "$numberLong": "9223372036854775807" }}',
];

foreach ($tests as $json) {
    printf("Test %s\n", $json);
    var_dump(MongoDB\BSON\Document::fromJSON($json)->toPHP());
    echo "\n";
}

?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
Test { "x": { "$numberLong": "-2147483648" }}
object(stdClass)#%d (%d) {
  ["x"]=>
  object(MongoDB\BSON\Int64)#%d (%d) {
    ["integer"]=>
    string(11) "-2147483648"
  }
}

Test { "x": { "$numberLong": "2147483647" }}
object(stdClass)#%d (%d) {
  ["x"]=>
  object(MongoDB\BSON\Int64)#%d (%d) {
    ["integer"]=>
    string(10) "2147483647"
  }
}

Test { "x": { "$numberLong": "4294967294" }}
object(stdClass)#%d (%d) {
  ["x"]=>
  object(MongoDB\BSON\Int64)#%d (%d) {
    ["integer"]=>
    string(10) "4294967294"
  }
}

Test { "x": { "$numberLong": "4294967295" }}
object(stdClass)#%d (%d) {
  ["x"]=>
  object(MongoDB\BSON\Int64)#%d (%d) {
    ["integer"]=>
    string(10) "4294967295"
  }
}

Test { "x": { "$numberLong": "9223372036854775807" }}
object(stdClass)#%d (%d) {
  ["x"]=>
  object(MongoDB\BSON\Int64)#%d (%d) {
    ["integer"]=>
    string(19) "9223372036854775807"
  }
}

Test { "longFieldName": { "$numberLong": "-2147483648" }}
object(stdClass)#%d (%d) {
  ["longFieldName"]=>
  object(MongoDB\BSON\Int64)#%d (%d) {
    ["integer"]=>
    string(11) "-2147483648"
  }
}

Test { "longFieldName": { "$numberLong": "2147483647" }}
object(stdClass)#%d (%d) {
  ["longFieldName"]=>
  object(MongoDB\BSON\Int64)#%d (%d) {
    ["integer"]=>
    string(10) "2147483647"
  }
}

Test { "longFieldName": { "$numberLong": "4294967294" }}
object(stdClass)#%d (%d) {
  ["longFieldName"]=>
  object(MongoDB\BSON\Int64)#%d (%d) {
    ["integer"]=>
    string(10) "4294967294"
  }
}

Test { "longFieldName": { "$numberLong": "4294967295" }}
object(stdClass)#%d (%d) {
  ["longFieldName"]=>
  object(MongoDB\BSON\Int64)#%d (%d) {
    ["integer"]=>
    string(10) "4294967295"
  }
}

Test { "longFieldName": { "$numberLong": "9223372036854775807" }}
object(stdClass)#%d (%d) {
  ["longFieldName"]=>
  object(MongoDB\BSON\Int64)#%d (%d) {
    ["integer"]=>
    string(19) "9223372036854775807"
  }
}

===DONE===
