Re: Properly working with binary data

[email protected] ("Christoph M. Becker")
Newsgroups php.general
Message-ID <[email protected]>
On 20.01.2023 at 13:39, Niklas Mollenhauer wrote:

> I'm currently trying to process binary data. I basically need something like an ArrayBuffer in JavaScript [1] as well
> as typed arrays [2] to read/write data and something like a DataView [3] with support for endianess conversion.
>
> […]
>
> Is there something to handle this in a performant manner? If not, this would also make a good candidate for a PHP
> extension (or even a built-in extension). Mimicking the API of JS could be a viable option.

There is some recent discussion on the internals mailing list about some
improvements in this regard[1], and there is a draft RFC[2].  Maybe
you're interested in this, in which case you should consider to join the
discussion.

Besides this, I'm not aware of any existing extensions which would help
with your use-case.

[1] <https://externals.io/message/119238>
[2] <https://wiki.php.net/rfc/working_with_substrings>

--
Christoph M. Becker
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.