-
Notifications
You must be signed in to change notification settings - Fork 0
Integer
Ryan Durham edited this page Nov 26, 2021
·
3 revisions
An XDR integer is a signed integer between -2147483648 and 2147483647.
You can encode an integer value like so:
use StageRightLabs\PhpXdr\XDR;
// Encode
$xdr = XDR::fresh()->write(42, XDR::INT);
To retrieve an integer value from the XDR buffer, you can decode it like so:
use StageRightLabs\PhpXdr\XDR;
$xdr = XDR::fresh()->write(42, XDR::INT);
// Decode
$int = $xdr->read(XDR::INT); // 42