Skip to content

Commit

Permalink
BinaryStream: revert usage of typed properties
Browse files Browse the repository at this point in the history
the main reason for this is a massive performance loss because of https://bugs.php.net/bug.php?id=81090, but the offset field also has some problems with JIT because of references - those problems won't be fixed until 8.0.7.
  • Loading branch information
dktapps committed May 30, 2021
1 parent 79fe81f commit 8cd078e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/BinaryStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@
use function substr;

class BinaryStream{
//TODO: use typed properties when https://bugs.php.net/bug.php?id=81090 is fixed

protected int $offset;
protected string $buffer;
/** @var int */
protected $offset;
/** @var string */
protected $buffer;

public function __construct(string $buffer = "", int $offset = 0){
$this->buffer = $buffer;
Expand Down

0 comments on commit 8cd078e

Please sign in to comment.