Skip to content

Commit

Permalink
PHP 7.4 compatibility (#19)
Browse files Browse the repository at this point in the history
* Test on PHP 7.4 on Travis

* Fix string offset access syntax with curly braces

* Fail on PHP 7.4

* Fix string offset access syntax with curly braces

* Lint all things for a good measure

* Update .travis.yml
  • Loading branch information
sanmai authored Jan 30, 2020
1 parent 2895f44 commit b724754
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
script:
- php vendor/bin/php-cs-fixer fix --dry-run --diff
- composer validate
- find OLE* -type f -name \*.php | xargs -n1 php -l

cache:
directories:
Expand Down
6 changes: 3 additions & 3 deletions OLE.php
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ static function Asc2Ucs($ascii)
{
$rawname = '';
for ($i = 0; $i < strlen($ascii); $i++) {
$rawname .= $ascii{$i} . "\x00";
$rawname .= $ascii[$i] . "\x00";
}
return $rawname;
}
Expand Down Expand Up @@ -582,14 +582,14 @@ static function OLE2LocalDate($string)
$factor = pow(2,32);
$high_part = 0;
for ($i = 0; $i < 4; $i++) {
list(, $high_part) = unpack('C', $string{(7 - $i)});
list(, $high_part) = unpack('C', $string[(7 - $i)]);
if ($i < 3) {
$high_part *= 0x100;
}
}
$low_part = 0;
for ($i = 4; $i < 8; $i++) {
list(, $low_part) = unpack('C', $string{(7 - $i)});
list(, $low_part) = unpack('C', $string[(7 - $i)]);
if ($i < 7) {
$low_part *= 0x100;
}
Expand Down

0 comments on commit b724754

Please sign in to comment.