mirror of
https://github.com/macintoshplus/mongo-php-driver.git
synced 2026-03-25 17:32:28 +01:00
* Introduce MongoDB\Driver\ServerApi * Accept serverApi driver option * Introduce create_test_manager factory to create manager A centralised entry point is required to inject the API_VERSION env variable later. * Add build variant to test with requireApiVersion=true * Fix wrong configuration for auth variable This changed when migrating from our own scripts to drivers-evergreen-tools and was not updated properly, causing all tests to run with auth disabled. * Declare ZEND_PARSE_PARAMETERS_NONE macro This macro is missing on PHP < 7.3 * Remove duplicated API param storage * Add missing semicolons * Add ZEND_PARSE_PARAMETERS_NON_EX macro * Extract error handling functionality to separate macros * Throw if internal mongoc_server_api_t is already initialised * Use imported namespaces in tools file * Fix type info for reflection * Use American English spelling * Only use typed serialize signature on PHP 8+ * Update PHONGO_PARSE_PARAMETERS_NONE macro for PHP < 7.3 * Remove usage of ZEND_STRL within zend_hash_str_add This causes compile failures on PHP < 7.3 that I have yet to understand. * Fix errors in new PHONGO_PARSE_PARAMETERS macros
50 lines
1.6 KiB
PHP
50 lines
1.6 KiB
PHP
--TEST--
|
|
PHPC-623: Numeric keys limited to unsigned 32-bit integer
|
|
--SKIPIF--
|
|
<?php if (8 !== PHP_INT_SIZE) { die('skip Only for 64-bit platform'); } ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
require_once __DIR__ . '/../utils/basic.inc';
|
|
|
|
$tests = [
|
|
[
|
|
'9781449410247' => 'a',
|
|
'X9781449410247' => 'b',
|
|
9781449410248 => 'c',
|
|
],
|
|
[
|
|
'4294967295' => 'a',
|
|
'4294967296' => 'b',
|
|
'4294967297' => 'c',
|
|
]
|
|
];
|
|
|
|
foreach ($tests as $test) {
|
|
printf("Test %s\n", json_encode($test));
|
|
$bson = fromPHP($test);
|
|
hex_dump($bson);
|
|
echo toJSON($bson), "\n\n";
|
|
}
|
|
|
|
?>
|
|
===DONE===
|
|
<?php exit(0); ?>
|
|
--EXPECT--
|
|
Test {"9781449410247":"a","X9781449410247":"b","9781449410248":"c"}
|
|
0 : 45 00 00 00 02 39 37 38 31 34 34 39 34 31 30 32 [E....97814494102]
|
|
10 : 34 37 00 02 00 00 00 61 00 02 58 39 37 38 31 34 [47.....a..X97814]
|
|
20 : 34 39 34 31 30 32 34 37 00 02 00 00 00 62 00 02 [49410247.....b..]
|
|
30 : 39 37 38 31 34 34 39 34 31 30 32 34 38 00 02 00 [9781449410248...]
|
|
40 : 00 00 63 00 00 [..c..]
|
|
{ "9781449410247" : "a", "X9781449410247" : "b", "9781449410248" : "c" }
|
|
|
|
Test {"4294967295":"a","4294967296":"b","4294967297":"c"}
|
|
0 : 3b 00 00 00 02 34 32 39 34 39 36 37 32 39 35 00 [;....4294967295.]
|
|
10 : 02 00 00 00 61 00 02 34 32 39 34 39 36 37 32 39 [....a..429496729]
|
|
20 : 36 00 02 00 00 00 62 00 02 34 32 39 34 39 36 37 [6.....b..4294967]
|
|
30 : 32 39 37 00 02 00 00 00 63 00 00 [297.....c..]
|
|
{ "4294967295" : "a", "4294967296" : "b", "4294967297" : "c" }
|
|
|
|
===DONE===
|