Skip to content

Commit

Permalink
Fix for array_shift bug that affects some php versions.
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/phpsurveyor@2588 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
David Olivier committed Mar 17, 2007
1 parent 796e0de commit 25e426a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions classes/php-gettext/gettext.php
Expand Up @@ -60,15 +60,27 @@ class gettext_reader {
* @access private
* @return Integer from the Stream
*/
function readint() {
/*function readint() {
if ($this->BYTEORDER == 0) {
// low endian
return array_shift(unpack('V', $this->STREAM->read(4)));
} else {
// big endian
return array_shift(unpack('N', $this->STREAM->read(4)));
}
}
}*/
// Fix for array_shift bug affecting some php versions
function readint() {
if ($this->BYTEORDER == 0) {
// low endian
$low_end = unpack('V', $this->STREAM->read(4));
return array_shift($low_end);
} else {
// big endian
$big_end = unpack('N', $this->STREAM->read(4));
return array_shift($big_end);
}
}

/**
* Reads an array of Integers from the Stream
Expand Down

0 comments on commit 25e426a

Please sign in to comment.