File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -10,15 +10,18 @@ echo throws(function() {
10
10
}, 'MongoDB\Driver\Exception\InvalidArgumentException ' ), "\n" ;
11
11
12
12
echo throws (function () {
13
- new MongoDB \BSON \Timestamp (-2147483648 , 0 );
13
+ /* I realise that "-2147483647 - 1" could be written as "-2147483648", *however*, PHP considers
14
+ * the latter a floating point number, as it parses "-" and "2147483648" separately, and
15
+ * "2147483648" doesn't fit in the 32-bit signed range. */
16
+ new MongoDB \BSON \Timestamp (-2147483647 - 1 , 0 );
14
17
}, 'MongoDB\Driver\Exception\InvalidArgumentException ' ), "\n" ;
15
18
16
19
echo throws (function () {
17
20
new MongoDB \BSON \Timestamp (0 , -1 );
18
21
}, 'MongoDB\Driver\Exception\InvalidArgumentException ' ), "\n" ;
19
22
20
23
echo throws (function () {
21
- new MongoDB \BSON \Timestamp (0 , -2147483648 );
24
+ new MongoDB \BSON \Timestamp (0 , -2147483647 - 1 );
22
25
}, 'MongoDB\Driver\Exception\InvalidArgumentException ' ), "\n" ;
23
26
24
27
?>
You can’t perform that action at this time.
0 commit comments