Closed
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