We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c743d0c + aa31d7e commit c6a218cCopy full SHA for c6a218c
ext/dba/tests/bug38698.phpt
@@ -8,10 +8,18 @@ Bug #38698 (Bug #38698 for some keys cdbmake creates corrupted db and cdb can't
8
--FILE--
9
<?php
10
11
+function isLittleEndian() {
12
+ return 0x00FF === current(unpack('v', pack('S',0x00FF)));
13
+}
14
+
15
$db_file = dirname(__FILE__) .'/129php.cdb';
16
17
if (($db_make=dba_open($db_file, "n", 'cdb_make'))!==FALSE) {
- dba_insert(pack('i',129), "Booo!", $db_make);
18
+ if (isLittleEndian() === FALSE) {
19
+ dba_insert(pack('V',129), "Booo!", $db_make);
20
+ } else{
21
+ dba_insert(pack('i',129), "Booo!", $db_make);
22
+ }
23
dba_close($db_make);
24
// write md5 checksum of generated database file
25
var_dump(md5_file($db_file));
0 commit comments