martin-g commented on code in PR #3634:
URL: https://github.com/apache/avro/pull/3634#discussion_r2731883707


##########
lang/php/lib/IO/AvroStringIO.php:
##########
@@ -147,21 +126,21 @@ public function seek($offset, $whence = self::SEEK_SET): 
bool
                 if (0 > $offset) {
                     throw new AvroIOException('Cannot seek before beginning of 
file.');
                 }
-                $this->current_index = $offset;
+                $this->currentIndex = $offset;
 
                 break;
             case self::SEEK_CUR:
-                if (0 > $this->current_index + $whence) {
+                if (0 > $this->currentIndex + $whence) {

Review Comment:
   Well, I have 0 experience with PHP but AFAIU `$whence` is used to tell from 
which position in the file to seek (beginning, current, end). In the other 
switch arms it checks whether the calculated position is a negative value. Just 
for `SEEK_CUR` it uses the `$whence` instead of `$offset`.
   I am 99.9% certain this is a bug.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to