src/PelConvert.php
public static function sLongToBytes($value, $endian)
    {
        /*
         * We can convert the number into bytes in the normal way using
         * shifts and modulo calculations here (in contrast with
         * longToBytes) because PHP automatically handles 32 bit signed
         * integers for us.
         */
        if ($endian == self::LITTLE_ENDIAN) {
            return (chr($value) . chr($value >> 8) . chr($value >> 16) . chr($value >> 24));
        } else {
            return (chr($value >> 24) . chr($value >> 16) . chr($value >> 8) . chr($value));
        }
    }
public static function sLongToBytes($value, $endian)
    {
        /*
         * We can convert the number into bytes in the normal way using
         * shifts and modulo calculations here (in contrast with
         * longToBytes) because PHP automatically handles 32 bit signed
         * integers for us.
         */
        if ($endian == self::LITTLE_ENDIAN) {
            return (chr($value) . chr($value >> 8) . chr($value >> 16) . chr($value >> 24));
        } else {
            return (chr($value >> 24) . chr($value >> 16) . chr($value >> 8) . chr($value));
        }
    }
public static function sLongToBytes ( $ value , $ endian ) { /*
         * We can convert the number into bytes in the normal way using
         * shifts and modulo calculations here (in contrast with
         * longToBytes) because PHP automatically handles 32 bit signed
         * integers for us.
         */ if ( $ endian == self :: LITTLE_ENDIAN ) { return ( chr ( $ value ) . chr ( $ value >> 8 ) . chr ( $ value >> 16 ) . chr ( $ value >> 24 ) ) ; } else { return ( chr ( $ value >> 24 ) . chr ( $ value >> 16 ) . chr ( $ value >> 8 ) . chr ( $ value ) ) ; } }
Convert a signed long into four bytes.

@param integer $value
the signed long that will be converted. The argument
will be treated as a signed 32 bit integer, from which the lower
four bytes will be extracted.

@param boolean $endian
one of {@link LITTLE_ENDIAN} and {@link
BIG_ENDIAN}.

@return string the bytes representing the signed long.
Convert a signed long into four bytes .