Skip to content

[php] issue with Bytes.fastGet #4060

Closed
Closed
@Simn

Description

class Main {
    static function main() {
        var b = haxe.io.Bytes.alloc(10);
        var bd = b.getData();
        b.set(1,20);
        Sys.println(haxe.io.Bytes.fastGet(bd, 1));
    }
}
    static function main() {
        $b = haxe_io_Bytes::alloc(10);
        $bd = $b->b;
        $b->b[1] = chr(20);
        Sys::println(ord($bd[1]));
    }

This prints 0 instead of the expected 20. As usual I'm at a loss here because it "looks" like this should work by accessing $bd[1]. It works if I change that to $b->b[1] which in my mindset is equivalent.

@mockey @tml: What's my misconception here and what can we do about it?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

platform-phpEverything related to PHP

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions