A binary number is a binary number regardless, so I don't think it
should do anything in sprintf. Did you want it to throw an error if
the number doesn't fit?
These integers will have the same lowest bits, regardless:
> sprintf("%1c",-2);
(13) Result: "\376"
> sprintf("%1c",254);
(14) Result: "\376"
> sprintf("%1c",254+65536);
(15) Result: "\376"
It seems '+' to sscanf means to read it as a signed integer, so for me
it works as expected:
> array_sscanf("\xff\xfe"*2,"%2c%-2c");
(23) Result: ({ /* 2 elements */
65534,
65279
})
> array_sscanf("\xff\xfe"*2,"%+2c%+-2c");
(24) Result: ({ /* 2 elements */
-2,
-257
})