diff options
author | Felipe Pena <felipensp@gmail.com> | 2013-06-26 13:50:43 -0300 |
---|---|---|
committer | Felipe Pena <felipensp@gmail.com> | 2013-06-26 13:50:43 -0300 |
commit | aa31d7e1efd27a230e91fcce00c8117227126080 (patch) | |
tree | 270debefd20c4b76e0fc1b63ac987eccb3c5bc9f /ext/dba | |
parent | 32f11e4ee6eecb06607a92303467416d093799f8 (diff) | |
parent | 7e33b5d2fa89a6bf167fc4061dcf6aedab1cc6b8 (diff) | |
download | php-git-aa31d7e1efd27a230e91fcce00c8117227126080.tar.gz |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
- Fixed bug #63409 (php-dba function test fails on big-endian machine) patch by: tianhonglouis at gmail dot com
Diffstat (limited to 'ext/dba')
-rw-r--r-- | ext/dba/tests/bug38698.phpt | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/dba/tests/bug38698.phpt b/ext/dba/tests/bug38698.phpt index 56dde85268..1d1ed674fe 100644 --- a/ext/dba/tests/bug38698.phpt +++ b/ext/dba/tests/bug38698.phpt @@ -8,10 +8,18 @@ Bug #38698 (Bug #38698 for some keys cdbmake creates corrupted db and cdb can't --FILE-- <?php +function isLittleEndian() { + return 0x00FF === current(unpack('v', pack('S',0x00FF))); +} + $db_file = dirname(__FILE__) .'/129php.cdb'; if (($db_make=dba_open($db_file, "n", 'cdb_make'))!==FALSE) { - dba_insert(pack('i',129), "Booo!", $db_make); + if (isLittleEndian() === FALSE) { + dba_insert(pack('V',129), "Booo!", $db_make); + } else{ + dba_insert(pack('i',129), "Booo!", $db_make); + } dba_close($db_make); // write md5 checksum of generated database file var_dump(md5_file($db_file)); |