Skip to content

Commit

Permalink
String offset access syntax with curly braces (PHP 7.4 compat)
Browse files Browse the repository at this point in the history
  • Loading branch information
kornrunner committed Jul 23, 2019
1 parent 3446552 commit ddf799b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/php/org/bovigo/vfs/content/LargeFileContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected function doRead(int $offset, int $count): string
protected function doWrite(string $data, int $offset, int $length)
{
for ($i = 0; $i < $length; $i++) {
$this->content[$i + $offset] = $data{$i};
$this->content[$i + $offset] = substr($data, $i, 1);
}

if ($offset >= $this->size) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/org/bovigo/vfs/vfsStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public static function newFile(string $name, int $permissions = null): vfsStream
*/
public static function newDirectory(string $name, int $permissions = null): vfsStreamDirectory
{
if ('/' === $name{0}) {
if ('/' === substr($name, 0, 1)) {
$name = substr($name, 1);
}

Expand Down

0 comments on commit ddf799b

Please sign in to comment.