<?php
$a = "\x01\x00\x00\x00"; // 1 (32-bit little-endian)
$b = "\x02\x00\x00\x00"; // 2 (32-bit little-endian)
echo "Before: " . bin2hex($a) . PHP_EOL;
sodium_add($a, $b);
echo "After: " . bin2hex($a) . PHP_EOL;
?>
Output:
Before: 01000000
After: 03000000